- Home /
GUI Crosshair
How would I go about making a GUI crosshair ? My idea is that the controls move the crosshair and pressing fire shoots a bullet , but can I instantiate the bullet from the location of the crosshair. If not how would I get the gun to shoot where the crosshair is aiming at ?
Thanks , Stealth
Answer by ZenithCode · Aug 30, 2013 at 11:35 AM
Hey,
Yes you need to change from screen to world coordinates using this:
http://docs.unity3d.com/Documentation/ScriptReference/Camera.ScreenToWorldPoint.html
That's World to screen would I just switch Camera.WorldToScreen to Camera.ScreenToWorld ?
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
Limit on GUI Components? 0 Answers
How To Make Ammo & Realod for Gun & Spark for Gun ? 0 Answers
Rigidbody Gravity scripting question (Javascript Answers Only!) 3 Answers
[Solved]GUI won't pop out 1 Answer