スクリプトリファレンス

説明

Manipulate a GameObject’s position on the X axis (red axis) of the transform in world space. Unlike Vector3.right, Transform.right moves the GameObject while also considering its rotation.

When a GameObject is rotated, the red arrow representing the X axis of the GameObject also changes direction. Transform.right moves the GameObject in the red arrow’s axis (X).

For moving the GameObject on the X axis while ignoring rotation, see Vector3.right.

//Attach this script to a GameObject with a Rigidbody2D component. Use the left and right arrow keys to see the transform in action.
//Use the up and down keys to change the rotation, and see how using Transform.right differs from using Vector3.right