I have an object with a rigidbody2D and a box collider 2D component. I’m trying to move the object with the following code:
rigidbody2D.MovePosition(rigidbody2D.position + Vector3.right * speed * Time.deltaTime);
I can’t find MovePosition inside rigidbody2D but I saw on the Unity official documentation that MovePosition should be in rigidbody2D I’m not sure about position, I haven’t checked the documentation for that one, so it could be that now it doesn’t belong there (even if in the original rigidbody there was rigidbody.position).
If you can tell me where to find MovePosition and position inside rigidbody2D I’d be so grateful.
Thanks for the help