Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: coxy17 on June 18, 2014, 03:36:20 AM

Title: Multiple Raycast on one objects axis conflicting [SOLVED]
Post by: coxy17 on June 18, 2014, 03:36:20 AM
Hi, at the moment i have a raycast fire from my player when entering a trigger.

I have now setup a raycast for when my player is jumping forward (parabola) as i want to know when they hit a wall. This i need to be from the player too.

What is the best way to do this? or is it not possible to have 2 raycasts coming from the players same axis (z) at one time?

I can get both raycasts to work individually but the problem is whent he player is jumping forward whilst they are in the Trigger area. as this means 2 raycasts are happening.

thanks

Nick
Title: Re: Multiple Raycast on one object
Post by: coxy17 on June 19, 2014, 04:28:11 AM
I figured it out, i needed 2 different raycasts from the players Z axis. Both didnt need to happen at the same time but in certain situations it was an issue as it was trying to Raycast at the same time. I needed to separate these so i did the following....

1. i just setup a EmptyGameObject and called it RaycastManager (or something like that)

2. i have 2 events in seperate FSM's so for each event i setup a Global Boolean (let me know when im doing an action)

3. then i used a BoolTest to manage which raycast to initiate and send a message to the FSM event to go ahead and Raycast along Z axis.

Nick