|
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
(comments are locked)
|
|
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.
(comments are locked)
|
|
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.
(comments are locked)
|

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 programming 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