How people make smooth player movement?

Been looking at other posts on this website to try to find out how people make a smooth player movement.

This is the example I’m looking for.


As you can see, a character’s torso goes right, left, front, or back which I’m trying to find it out how to do it.

5 Likes

They are using the UserInputService. Check it out here: UserInputService | Documentation - Roblox Creator Hub

1 Like

I see, do I have to rotate HumanoidRootPart with Cframing or Tweenservice? if it is then that would be kind of hard for me, but I can give a try.

1 Like

They are not using UIS, this is inverse kinematics.

5 Likes

Oh what’s Inverse Kinematics? I never heard of it.

I’m not too advanced in it, so I can’t explain the code behind it, but basically its moving joints so the touch they ground where they should land.
There are a couple IK tutorials on the devforum, you should be able to find one for R6.

1 Like

I mean, I’m trying to make something like this on this topic.

Take a look at this module: Inverse Kinematics Module - Easy Solver

2 Likes

Currently checking it out, I really don’t know what even I am doing right now, but I know how to put stuff to the right spots.

2 Likes

That just looks like specific animations playing (which, by default, uses Inverse Kinematics) for a specific movement direction. The smooth fading into the next animation is controlled by the fade of the playing of the next animation.

It’ll fade into the next animation and not snap to it. Giving you that smoothness you’re looking for.

1 Like

Not looking for specific movement on animations. Just moving the Torso.

Oh if it’s just the torso then this other resource may help:

This is the bit of code that handles the torso leaning and also rotation using the character’s current velocity…A bit complex but I think it’s possible to learn if you separate the CFrame operations one by one and subsitute values for it and see what changes.

        local relv0		=lowercf:vectorToObjectSpace(rootvel)
        local relv1		=relv0*0.2
        
        do -- Upper Torso
            local goalCF = waistjoint.C1:Lerp(waist1*ANGLES(math.rad(relv1.Z),0.1*math.cos(right)-2*math.rad(relv1.X),math.rad(-relv1.X)):inverse(),dt10)	
waistjoint.C1	=	goalCF
end
1 Like

That is Body Lerping. Any movement you do from side to side it would lerp the body. You would need to make animations to do that

1 Like

@anxlr

Do you know how body lerping works? If so, please explain. Quite late but I would love to find out more about this!