Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class MoveCube : MonoBehaviour {
  6.  
  7. public float moveSpeed;
  8.  
  9. void Start()
  10. {
  11. moveSpeed=5f;
  12. }
  13.  
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. transform.Translate(moveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime,0f,moveSpeed * Input.GetAxis("Vertical") * Time.deltaTime); }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement