Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 61 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class TurretControls : MonoBehaviour {
  5.  
  6.     public Transform turret;
  7.     public Transform weapon;
  8.     public Transform cameraCenter;
  9.     public LayerMask layersAllowed;
  10.     public float rangeOfRay;
  11.    
  12.     private RaycastHit target;
  13.    
  14.    
  15.    
  16.     // Use this for initialization
  17.     void Start () {
  18.    
  19.     }
  20.    
  21.     // Update is called once per frame
  22.     void Update () {
  23.      //Ray cameraRay = new Ray(cameraCenter.position, cameraCenter.forward);
  24.         //if (Physics.Raycast(cameraRay, out target, rangeOfRay, layersAllowed.value)){
  25.             //turret.LookAt(target.point);
  26.         if (Input.GetKey("v")){
  27.                 turret.transform.Rotate(Vector3.up, 100 * Time.deltaTime );
  28.         }      
  29.        
  30.         if (Input.GetKey("b")){
  31.                 turret.transform.Rotate( Vector3.up, -100* Time.deltaTime );
  32.         }
  33.            
  34.        
  35.         }
  36.    
  37.    
  38.  
  39.        
  40.    
  41.     }
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