Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update ()
- {
- if (Input.GetKey(KeyCode.LeftArrow))
- {
- transform.position += Vector3.left * speed * Time.deltaTime;
- }
- if (Input.GetKey(KeyCode.RightArrow))
- {
- transform.position += Vector3.right * speed * Time.deltaTime;
- }
- if (Input.GetKey(KeyCode.UpArrow))
- {
- transform.position += Vector3.up * speed * Time.deltaTime;
- }
- if (Input.GetKey(KeyCode.DownArrow))
- {
- transform.position += Vector3.down * speed * Time.deltaTime;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement