|
How could I make it so that raycasts always hit my crosshair in the middle of the screen? The script is on my gun which is to the right of me, so the raycast goes to the right.
(comments are locked)
|
|
Look at I think you'd be better off ignoring the gun position for aiming, and just doing a straight raycast right down the center of the screen. You could then draw a line or something from the gun to the target, for effect. Otherwise, you get a diagonal raycast (with respect to the screen) and the crosshair will only be correct for one paticular distance. How could I integrate this into my code? But anyway, I guess I could just put the code on the camera.
May 22 '11 at 01:56 AM
Max 4
In your update, you have a raycast (it goes left, from the gun?) Instead, use a raycast directly out from the crosshair -- if the crosshair is over a duck, the raycast will hit it. Think of it as finding what's under the mouse (plenty of answers for that,) except the mouse is always in the same spot.
May 22 '11 at 02:19 AM
Owen Reynolds
(comments are locked)
|
