Having trouble with lerping

I’m making a aim mechanic for my gun system and I’m trying to use lerp so the player rotates smoothly because when he try to aim it’s basically gonna make him shiftlock. hopefully this makes more sense from these refrences.

Example of what I’m trying to accomplish: (You can see how smooth the character rotates)


Before Attempting lerp:

After Attempting Lerp:

Script:


Errors:

1 Like

You could try achieving a smooth rotation like in that video by using a oneattachment mode alignorientation with attachment0 being rootattachment in the humanoidrootpart, when they shift lock you can enable it and set the align orientation CFrame to CFrame.lookAt(Vector3.zero,CameraLookVector*Vector3.new(1,0,1))
in a renderstepped runservice event

2 Likes

You can use this lerp CFrame formula

currentCF:Lerp(newCF, alpha)

Alpha is done through a special formula below:

2 Likes

you can use body movers or constraints to achieve this effect, simply when right button pressed send info to enable constraint and send new direction to aim

1 Like

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