playMaker

Author Topic: Multiple Raycast on one objects axis conflicting [SOLVED]  (Read 2038 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Multiple Raycast on one objects axis conflicting [SOLVED]
« 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
« Last Edit: June 19, 2014, 04:30:49 AM by coxy17 »

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Multiple Raycast on one object
« Reply #1 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
« Last Edit: June 19, 2014, 04:29:57 AM by coxy17 »