タイトルの通りなのですが「現在地」のゲームオブジェクトのx軸だけ
変更したいのですが、どうして良いか分からず困っております。
どなたかお詳しい方がいらっしゃいましたら。
解決策をお教え頂けたら幸いですm(_ _)m
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class Position : MonoBehaviour 6{ 7 // Start is called before the first frame update 8 void Start() 9 { 10 11 } 12 13 // Update is called once per frame 14 void Update() 15 { 16 17 } 18 19 void OnCollisionEnter(Collision collision) 20 { 21 if(collision.gameObject.tag == "Restart") 22 { 23 transform.localPosition = new Vector3(x,y,z); 24 } 25 } 26} 27
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/17 21:24