Ah. Managed to replicate it. Apparently my project had the compatibility option ‘Auto Sync Transforms’ enabled.
If I set it to false I get the result that you describe.
So if I understand this correctly, what happens is that my scripts set the position using rigidbody.MovePosition and the rotation using transform.rotation, however the next physics update the engine notices that the transform has changed (by setting the rotation) so it copies over the complete transform (rotation AND position) to the rigidbody resulting in that the rigidbody.MovePosition call is overwritten by old position info. Do you think this is what happens?
I’m not quite sure why it moves sometimes though… Possibly that happens when the rotation didn’t change at all?
Good point, I forgot the step where I turned off ‘Auto Sync Transforms’
There is supposed to be a performance boost with it turned off, and I didn’t think I needed it, however, it turns out I needed to turn it back on…
I think your theory for why it happens is correct. And the case I ran into was where some of my players use CharacterController components. There is no way to set the physics position of a CharacterController (only Move & SimpleMove which aren’t the same as a teleport). So I had to set the transform position (network syncing), which ended up causing the same horrible not-really-moving sometimes behavior!