Hi, i started unity not that long ago and i came across an issue the movement for my enemies is jittery, can you tell me how to fix that?
There’s essentially three ways to move physical objects.
You’re combining the transform positioning of Transform.LookAt()
with the physics system positioning of Rigidbody.velocity
. Add some collisions between the yellow blocks, and you’re sure to get jitter because the Rigidbody will fight your updates to the transform.
If you want things to be handled by the physics system, avoid writing to the transform. Use Rigidbody methods, either by controlling motion directly with .velocity/.angularVelocity, or controlling motion indirectly with .AddForce()/.AddTorque(), ideally choosing one set over the other.