Does modifying transform.position in fixed update mean that it will be in sync with rigidbody movement in fixed update or will there be jittering and rubberbanding even then.
For example, if a gameobject X with a rigidbody component is rotating towards another gameobject Y which does not have a rigid body, do i need to write Y’s constant movement in update or fixed update as to make the X object rotate smoothly and not jitter
The basic rule of thumb is to not modify transform.position directly when dealing with physics. This is because of obvious reasons: the Transform component has no knowledge of physics (no velocity, no forces, no proper collision detection), so changing transform.position just teleports the object to a new position disregarding physical behavior.
Physics are handled by the Rigidbody component so 99% of the time you want to use Rigidbody.MovePosition() instead. If you have an object that doesn’t need to have physics applied to it but must move around physically affecting other objects, make it a kinematic rigidbody and use MovePosition.
1 Like