#Changing the z axis kinda breaks the camera

1 messages · Page 1 of 1 (latest)

wide dagger
#

I found this post showing how to Make first person camera be in head’s position and it works perfectly untell i change the cameras z axis in line 13, also if possible someone tell me how to make it a server-side script so all players can see it thx.

local cam = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local RunService = game:GetService("RunService")

local char = plr.Character or plr.CharacterAdded:Wait()
local upperTorso = char:WaitForChild("UpperTorso")

local waist = upperTorso:WaitForChild("Waist")

local y = waist.C0.Y

RunService.RenderStepped:Connect(function()
    char.Humanoid.CameraOffset = (char:WaitForChild("HumanoidRootPart").CFrame + Vector3.new(0, 1, 0)):PointToObjectSpace(char:WaitForChild("Head").Position)
    if waist then
        local camDirection = cam.CFrame.LookVector
        local angle = math.deg(camDirection:Angle(char:WaitForChild("HumanoidRootPart").CFrame.LookVector, cam.CFrame.RightVector))
        waist.C0 = waist.C0:Lerp((CFrame.new(0, y, 0) * CFrame.Angles(math.rad(math.clamp(-angle, -70, 70)),0,0)), 0.5/2)
        
    end
end)
inland flicker
inland flicker
#

In the solution to the post they use a different y value.

char.Humanoid.CameraOffset = (char:WaitForChild("HumanoidRootPart").CFrame + Vector3.new(0, 1.5, 0)):PointToObjectSpace(char:WaitForChild("Head").Position)
#

Maybe try that out?

wide dagger
wide dagger
#

it looks like this

inland flicker
# wide dagger i meant the torso and head follow where the player looks

Inverse kinematics is the mathematical process of calculating the variable joint parameters needed to place the end of a kinematic chain.

Become a member for great Channel and Discord perks!: https://www.youtube.com/channel/UCmIFjYx2aXrTjy5H8Zz1IfA/join
Discord Server: https://discord.gg/Fk8CF67RE7

If the invite doesn't work, try it from here:...

▶ Play video
inland flicker
agile plover
#

it shatters into 10 million pieces

inland flicker
inland flicker
wide dagger
inland flicker
wide dagger
inland flicker
#

why don't you actually just make the torso invisible tho. (For the client) Wouldn't that make things so much easier

wide dagger
#

it does fix it but i want the player to be able to see their body, im just gonna scrap the torso moving thing and just make the head move where the player looks instead