空のオブジェクト にスクリプトをつけてやってるですか なぜか動きません
いちよAを押せば二つのオブジェクトtが特定の位置に行くものを書こうとしました
試したコード
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class NewBehaviourScript : MonoBehaviour { // Start is called before the first frame update void Start() { } public Transform Target; public Transform agent; // Update is called once per frame void Update() { //右クリックを受け付ける if (Input.GetKey(KeyCode.A)) { // transformを取得 agent.position = Translate(0.1f, 0.0f, 0.0f); Target.position = Translate(0.1f, 0.0f, 0.0f); } }
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。