Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: greg on March 29, 2013, 07:45:18 AM

Title: Raycasting to Crosshair [solved]
Post by: greg on March 29, 2013, 07:45:18 AM
Hello playmaker devs :)

I'm making a FPS with dual guns - it has 2 crosshairs. Normally you'd raycast forward from the centre of the screen and perspective wouldn't matter.. however, the two crosshairs aren't in the centre of the screen.. so perspective messes with the aiming.

Could anyone help me with a solution to this, it is proving to be a challenge? I basically want to orthographically raycast from camera to crosshair.. i think this may be part of the solution, but i'm not sure:

http://docs.unity3d.com/Documentation/ScriptReference/Camera.ScreenPointToRay.html
(^if this is indeed the correct solution, i dont suppose some kind soul could provide me with a custom action like the normal raycast one)

Thankyou!
Title: Re: Raycasting to Crosshair
Post by: Alex Chouls on March 29, 2013, 12:08:42 PM
Take a look at the Screen Pick action...
Title: Re: Raycasting to Crosshair
Post by: greg on March 29, 2013, 12:26:06 PM
hahaha *Doh*  8)