Advertisement
Guest User

Untitled

a guest
Oct 31st, 2017
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BaseRotationScript : MonoBehaviour {
  6.  
  7.     public float RotSpeed = 1f;
  8.  
  9.     void Update ()
  10.     {
  11.         if(Input.GetKey(KeyCode.A))
  12.         {
  13.             transform.Rotate(0, -RotSpeed, 0);
  14.         }
  15.  
  16.         else if(Input.GetKey(KeyCode.D))
  17.         {
  18.             transform.Rotate(0, RotSpeed, 0);
  19.         }
  20.     }
  21. }
Advertisement
RAW Paste Data Copied
Advertisement