MovePositionAndRotation
Moves the rigidbody position to position and the rigidbody angle to angle.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
MovePositionAndRotation(Vector2, float)
Moves the rigidbody position to and the rigidbody angle to .
positionanglepublic void MovePositionAndRotation(Vector2 position, float angle)
Parameters
Remarks
This is a combination of calling both MovePosition and MoveRotation. This can be used to increase performance by not having to perform two separate calls to queue movements.
For more details on the operation of movement using these methods, refer to Rigidbody2D.MovePosition and Rigidbody2D.MoveRotation.
MovePositionAndRotation(Vector2, Quaternion)
Moves the rigidbody position to and the rigidbody angle to .
positionrotationpublic void MovePositionAndRotation(Vector2 position, Quaternion rotation)
Parameters
The position to move the rigidbody to.
The rotation to move the rigidbody to. Only the Z-Axis rotation is used from the full 3D Quaternion rotation.
Remarks
This is a combination of calling both MovePosition and MoveRotation. This can be used to increase performance by not having to perform two separate calls to queue movements.
For more details on the operation of movement using these methods, refer to Rigidbody2D.MovePosition and Rigidbody2D.MoveRotation.