Version: 2023.1

Rigidbody2D.MovePositionAndRotation

切换到手册
public void MovePositionAndRotation (Vector2 position, float angle);

参数

position The position to move the rigidbody to.
angle The angle to move the rigidbody to.

描述

Moves the rigidbody position to position and the rigidbody angle to angle.

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, see Rigidbody2D.MovePosition and Rigidbody2D.MoveRotation.


public void MovePositionAndRotation (Vector2 position, Quaternion rotation);

参数

position The position to move the rigidbody to.
rotation The rotation to move the rigidbody to. Only the Z-Axis rotation is used from the full 3D Quaternion rotation.

描述

Moves the rigidbody position to position and the rigidbody angle to rotation.

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, see Rigidbody2D.MovePosition and Rigidbody2D.MoveRotation.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961