Rigidbody.MovePosition in local space?

Stupid question: If I want to translate a rigidbody object the documentation suggests using Rigidbody.MovePosition istead of Transform.Translate so that the object does not skip steps between positions in fast movements.
Is there an easy way to make Rigidbody.MovePosition translate along local space or is it world space only at the moment?

Ttransform.Translate uses local space by default, as I understand it.

The change should be straight forward:

transform.Translate (localPositionOffset);

becomes

Vector3 newPosition = rigidbody.position + transform.TransformDirection (localPositionOffset);
rigidbody.MovePosition (newPosition);
8 Likes

Oh cool - I did not know transform.TransformDirection(localPositionOffset)
Thanks. :slight_smile:

Thanks so much I was looking for like an hour and couldn’t find anything - You really saved me:)