Help rotating the character where they are moving smoothly

So I wanna make it so the character tilts smoothly like this:

However when I tried doing it it turned out like this

I’ve searched far and wide but to no avail :pensive:

This is my code I’ve also tried using tweens and multiple different ways to rotating the character but they’re either very jittery or just rotates immediately or does weird stuff to the arms like you see in the video

		local vel = HRP.AssemblyLinearVelocity *, 0, 1)
		local angle = vel.Magnitude > 2 and (HRP.CFrame.RightVector:Dot(vel.Unit)/4.5)/2 or 0

		local LerpAngle = Lerp(angle, HRP.CFrame.RightVector:Dot(vel.Unit), 0.02)

		RootJoint.C1 = defaultC1 * CFrame.Angles(0, 0, LerpAngle)

this is in a renderstepped function

1 Like

I found this code that fixes the jittering but not the weird arms thing:

local tiltz = 0
local tiltx = 0
local movementVector = HRP.CFrame:VectorToObjectSpace(HRP.AssemblyLinearVelocity/math.max(Hum.WalkSpeed,0.01))
tiltZ = math.clamp(Lerp(tiltZ, movementVector.X,0.1),-0.25,0.25)
tiltX = math.clamp(Lerp(tiltX, math.abs(math.clamp(movementVector.Z,-1,0)),0.1),0,0.25)
RootJoint.C1 = defaultC1*CFrame.Angles(tiltX/2,0,tiltZ/2)

I fixed it by simply changing the StarterCharacter they’re both R15 so I don’t know what’s going on and most likely I’ll run into the issue again when we make character customization but it is what it is

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.