am working on a endless runner 3d game and the player seems to shake !!
so I notes the problem is that in the rotate the player to where is he going, but I cant figure it out where exactly the mistake here.
note it shake most of thr time not all the time.
and this is the code for rotating to where going
Vector3 dir = controller.velocity;
if (dir != Vector3.zero)
{
dir.y = 0;
transform.forward = Vector3.Lerp(transform.forward, dir, turn_Speed);
}
↧