How to limit mouse rotation at Z ?

Aug 24 2020 12:01 PM
my code here but it don't help though :(
  1. public class Pick : MonoBehaviour { public float RotationSpeed = 5;  
  2.   
  3.  void Update ()   
  4.  {  
  5.    
  6.  Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition)  
  7.  transform.rotation = Quaternion.LookRotation(Vector3.forward, mousePos - transform.position);  
  8.  }  
  9. }