Cara Move di Unity
using System . Collections ; using System . Collections . Generic ; using UnityEngine ; public class InputScript : MonoBehaviour { // Start is called before the first frame update void Start () { } // Update is called once per frame public Transform box ; public float speed ; void Update () { if ( Input . GetKey ( KeyCode . W )){ float x = box . position . x + speed ; float y = box . position . y ; float z = box . position . z ; box . position = new Vector3 ( x , y , z ); } if ( Input . GetKey ( KeyCode . S )){ float x = box . position . x - speed ; float y = box . position . y ; float z = box . position . z ; box . position = new Vector3 ( x , y , z ); } if ( Input . GetKey ( KeyCode . A )){ float x = box . position . x ; float y = box . position . y