daily pastebin goal
38%
SHARE
TWEET

Obracanie.cs

a guest Aug 21st, 2018 73 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. using UnityEngine.Networking;
  5.  
  6. public class Obracanie : NetworkBehaviour {
  7.  
  8.  
  9.  
  10.     public int MouseSens;
  11.     public Transform Hands;
  12.    
  13.    
  14.  
  15.  
  16.     // Use this for initialization
  17.     void Start () {
  18.  
  19.      
  20.     }
  21.    
  22.     // Update is called once per frame
  23.     void Update () {
  24.  
  25.        
  26.  
  27.         Turning();  
  28.        
  29.     }
  30.  
  31.    
  32.     void Turning()
  33.     {
  34.         if (isLocalPlayer)
  35.         {
  36.             float xRotate = Input.GetAxis("Mouse X") * MouseSens;
  37.             float yRotate = Input.GetAxis("Mouse Y") * MouseSens;
  38.  
  39.             Hands.eulerAngles += new Vector3(0f, xRotate , yRotate);
  40.         }
  41.     }
  42.  
  43.    
  44.    
  45. }
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