playMaker

Author Topic: Raycasting to Crosshair [solved]  (Read 4331 times)

greg

  • Junior Playmaker
  • **
  • Posts: 68
Raycasting to Crosshair [solved]
« 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!
« Last Edit: March 29, 2013, 01:48:22 PM by greg »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Raycasting to Crosshair
« Reply #1 on: March 29, 2013, 12:08:42 PM »
Take a look at the Screen Pick action...

greg

  • Junior Playmaker
  • **
  • Posts: 68
Re: Raycasting to Crosshair
« Reply #2 on: March 29, 2013, 12:26:06 PM »
hahaha *Doh*  8)