Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Rotation

$
0
0
I want to make this a rotation not a transform.position.x how do i do this (I tried transform.Rotate)
Code (JavaScript):
  1. unction Update()
  2. {
  3.  
  4.     if(Input.GetMouseButton(0))
  5.     {
  6.         ray = Camera.main.ScreenPointToRay (Input.mousePosition);
  7.        
  8.         if(Physics.Raycast (ray, rayCastHit))
  9.         {
  10.             transform.position.x = rayCastHit.point.x;
  11.            
  12.             }
  13.            
  14.         }
  15.        
  16.     }

Viewing all articles
Browse latest Browse all 1466670

Trending Articles