旋转到运动矢量 2

Rotation to Movement Vector2

我有一个带有 Rigidbody 2d 组件的 2D 游戏对象,我想根据它的旋转(Rigidbody2D.rotation - z 角)向前移动它。如何创建运动 Vector2?

这取决于你比赛中的前锋..

向前向上吗?

this.transform.position += this.transform.up * Time.deltaTime;

前向右吗?

this.transform.position += this.transform.right * Time.deltaTime;