- Home /
Question by
OmerPasa3328 · Aug 24, 2020 at 04:01 AM ·
mousepositionlimitations
How to limit mouse rotation at Z ?
my code here but it don't help though :(
public class Pick : MonoBehaviour { public float RotationSpeed = 5;
void Update ()
{
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.rotation = Quaternion.LookRotation(Vector3.forward, mousePos - transform.position);
}
}
Comment
Your answer
Follow this Question
Related Questions
Is there a way to get mouse position in 3D space at a given y-value? 2 Answers
Confusion on how to create Tools 0 Answers
GUI.DrawTexture Error: BCE0023 0 Answers
Top down aim at mouse 3 Answers