using System.Collections; using System.Collections.Generic; using UnityEngine; public class sayu : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKey(KeyCode.RightArrow)) { transfrom.Translate(1,0,0); } if (Input.GetKey(KeyCode.LeftArrow)) { transfrom.Translate(-1,0,0); } } } ミスったんですけどどこを修正したらOk?
@@semimarunko やり直してみたやつもだめだった using System.Collections; using System.Collections.Generic; using UnityEngine; public class Sayu : MonoBehaviour { public int speed = 10; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.Getkey(KeyCode.RightArrow)) { transform.Translate(speed * 1 * Time.deltaTime,0,0); } if (Input.Getkey(KeyCode.LeftArrow)) { transform.Translate(speed * -1 * Time.deltaTime,0,0); } } }