|
Hello, I'm currently busy on a sort of FPS game, I've got a crosshair in the middle of the screen but I need help with the positioning of the crosshair. I want to shoot to the crosshair, I'm using a raycast to shoot. I could use tips and "tutorial" like answers. I set up a little mini script showing whats the main thing my gun is doing: That's about it what I'm using the rest is just defining what the raycast hit. Thanks in advance! -Hybris
(comments are locked)
|
|
You'll probably want to use Camera.ScreenPointToRay(), passing in some useful data like the center of the screen, mouse cursor position, or so on. You can see an example here: http://answers.unity3d.com/questions/23683/air-strike-shoot-aiming-at-cross-hairs-in-middle-o.html Here's the script reference page: http://unity3d.com/support/documentation/ScriptReference/Camera.ScreenPointToRay
(comments are locked)
|

Should be able to find something already posted in here on this. I've seen the same question asked before at least once.
I searched but I couldnt find the 1 i was looking for