Unityでゲーム作っています。
その中で、あるゲームオブジェクトを動かして、指定の座標になったとき動きをやめとどまらせたいのですがその方法が分かりません。
今、オブジェクトを動かすところまではできているんで、どうやって座標[0, 0, 0]になったときにオブジェクトを停止できるか教えてください
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class posit : MonoBehaviour { 6 7 // Use this for initialization 8 void Start () { 9 this.gameObject.SetActive(false); 10 Invoke("Update", 5.5f); 11 } 12 13 // Update is called once per frame 14 void Update () { 15 this.gameObject.SetActive(true); 16 this.gameObject.transform.Translate (-0.2f, 0, 0); 17 } 18}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。