I use rigidbody.MovePosition and for a few weeks my program has been working splendid. Yesturday I imported TextMeshPro, Universal Render Pipeline and Unity’s Particle System Prefab package. After this the project still worked fine. I booted up unity today and no matter what I do rb.velocity is 0. Once in a blue moon it will display a very large value (60 unity/s+) for just a moment. I have no idea what could have happened. Anyone have any ideas?
i think you are setting it’s velocity to 0 somewhere
Ensure to call Rigidbody.MovePosition exactly once per physics frame (FixedUpdate). If MovePosition is called twice or more times with the same value, then Rigidbody.velocity will be zero. This may happen if you’re calling MovePosition from Update or from some other event unrelated to physics.
If you’re explicitly calling Physics.Simulate(), then ensure that:
-
Call MovePosition exactly once before calling Physics.Simulate().
-
Physics.autoSimulation is not being set back to true somewhere else.