お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Closeワールド空間のTransformの位置
// Move the object to (0, 0, 0) transform.position = Vector3(0, 0, 0); // Print the x component of the position to the Console print(transform.position.x);
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { transform.position = new Vector3(0, 0, 0); print(transform.position.x); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: transform.position = Vector3(0, 0, 0) print(transform.position.x)