issue: when you are at 0 rotation and you move your camera everything works fine, but when u start moving around it gets all forked up

--you need to be r15

local TurnSpeed = .2	
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local RootPart = Character:WaitForChild("HumanoidRootPart")
local UpperTorso = Character:WaitForChild("UpperTorso")
local Head = Character:WaitForChild("Head")
local Neck = Head:WaitForChild("Neck")
local Waist = UpperTorso:WaitForChild("Waist")
local Camera = workspace.CurrentCamera

wait(1)

game:GetService('RunService').RenderStepped:connect(function()
local dir = (Camera.CoordinateFrame.p-UpperTorso.Position).unit
local acosine = math.acos(dir.y)
local sin = math.sin(dir.x)

Neck.C1 = Neck.C1:lerp(CFrame.new(0,-0.5,0)*CFrame.Angles(-(acosine/2)+math.rad(45),-sin,0),TurnSpeed)
Waist.C1 = Waist.C1:lerp(CFrame.new(0,-0.5,0)*CFrame.Angles(-(acosine/2)+math.rad(45),-sin,0),TurnSpeed)
end)

so i'm trying to make it so it does not turn weird when moving around

thank you!

2 comments

0

What exactly is your end goal? What are you making?

0

the code is pretty self explanatory, but im trying to make your character look to ur direction of ur camera: https://gyazo.com/58d4905e018dd0686ffa378695c1811b