- Home /
crosshair pointer
How can i shoot at the crosshair or how can i shoot at the middle of the screen or how can i know the position of the Gui laber and shoot at it?
Comment
Best Answer
Answer by whydoidoit · Jul 01, 2012 at 11:32 AM
Use:
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
Then instantiate the bullet:
Instantiate(bulletPrefab, ray.origin, Quaternion.LookRotation(ray.direction));
Your answer
Follow this Question
Related Questions
Deadfrontier type crosshair 1 Answer
Raycast Terrain And get the collider position for crosshair 1 Answer
Rotate gun to mouselook 1 Answer
How to control opacity in Cross Hair? 1 Answer
Use IK or what? 1 Answer