SHARE
TWEET

Small

a guest Apr 24th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class TransformMove : MonoBehaviour
  2. {
  3.     public GameObject obj;
  4.    
  5.     void Update()
  6.     {
  7.        
  8.  
  9.         if (Input.GetKey(KeyCode.UpArrow))
  10.             obj.transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
  11.  
  12.         if (Input.GetKey(KeyCode.DownArrow))
  13.             obj.transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);
  14.  
  15.         if (Input.GetKey(KeyCode.LeftArrow))
  16.             obj.transform.Rotate(Vector3.up * -turnSpeed * Time.deltaTime);
  17.  
  18.         if (Input.GetKey(KeyCode.RightArrow))
  19.             obj.transform.Rotate(Vector3.up * turnSpeed * Time.deltaTime);
  20.        
  21.         if (Input.GetKey(KeyCode.S))
  22.             obj.transform.localScale = new Vector3(transform.localScale.x / 2, transform.localScale.y / 2, transform.localScale.z / 2);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top