Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class movement : MonoBehaviour {
  6.  
  7.     float width = 8;
  8.     float height = 4;
  9.  
  10.     void Update () {
  11.         Vector3 controllerVector = new Vector3(Input.GetAxis("Horizontal") * (width / 2), Input.GetAxis("Vertical") * (height / 2), 0);
  12.  
  13.         transform.position = controllerVector;
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement