- Home /
crosshair help needed
hello everyone
i have a cross hair in my third person shooter game and it moves around with my mouse. so basically where ever my mouse is that's where the cross hair is as well. I need help making it so that my bullets that my character fires land within the cross hair that i have. i also want my player to turn to face which ever direction the cross hair is facing because it can spin in a 360 degree angle. any help will be really appreciated. i have little experience with scripting so please try to help me.
thanks in advance
Please be aware that we aren't going to give you a script that you can just plug into your game and it'll "just work". Unity requires pretty solid program$$anonymous$$g skills if you want to make games, so you should look under the Scripting section of this page to begin learning how: http://answers.unity3d.com/questions/4897/how-can-i-start-learning-unity-fast
Answer by Thomas Hentschel Lund · Jun 21, 2010 at 10:08 AM
Having done these 3rd person crosshairs before, the way to do it is to shoot a ray from the camera through your crosshair (I take it that its at the center of the screen - and thus the camera ray would automagically go through it) - and then see where your crosshair collides with geometry.
You then use THAT position to point your character and his gun towards.
Answer by Ashkan_gc · Jun 21, 2010 at 07:09 AM
there is a complete in depth FPS tutorial in unity's website. basically you can use mouse look script of standard assets and always draw a crosshair in center of the screen.
Your answer
Follow this Question
Related Questions
Machine Gun aim to crosshair 3 Answers
How make Raycast Aim to Crosshair? 1 Answer
Reload Ammo is not working 1 Answer
My crosshair is moving the opposite of the mouse position. Why? 1 Answer
Avert Fate Style FPS Gun Script 3 Answers