playMaker

Author Topic: GetNextSphereCastAllHit  (Read 5258 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
GetNextSphereCastAllHit
« on: April 17, 2013, 02:57:23 AM »
Hi,

 Following a request: http://hutonggames.com/playmakerforum/index.php?topic=3658.0

Please find a action that will loop through all hits of a sphereCast, it's the same as a ray cast only you give a radius to give a volume to the casting.

 Bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: GetNextSphereCastAllHit
« Reply #1 on: April 17, 2013, 05:07:58 AM »
Thanks for the action.
But i dont understand the Hit Events.
how does the "Loop Event" work? Is it similar to a Hit (True) Event?

Also the Spherecast is very slow compared to the Raycast. Is this due to its nature or because of the ALL HIT LOOPING function (which i dont realy understand)?

Compared to the Raycast action there is also no Repeat Interval

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: GetNextSphereCastAllHit
« Reply #2 on: April 17, 2013, 05:11:46 AM »
I forgot to delete a "wait" action wich caused my FSM to be slow! So forget about that.

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: GetNextSphereCastAllHit
« Reply #3 on: April 18, 2013, 04:02:00 AM »
Can you explain the Looping function?
I dont understand the Next and Finished Events.
Could you compare it to the Events in the Raycast action?

With Raycast i just have a HIT Event to jump out of the state. With no hit it just passes on in the state (FINISHED).

Thanks,
Matthias

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GetNextSphereCastAllHit
« Reply #4 on: April 22, 2013, 01:13:18 AM »
Hi,

if the cast detects more than one object, it will trigger the "LOOP" event and within that loop you can use the RayCast Hit get info:

https://hutonggames.fogbugz.com/default.asp?W491


when all objects are looped, it fires the End event.

does that make more sense?


 bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: GetNextSphereCastAllHit
« Reply #5 on: April 22, 2013, 07:43:31 AM »
Okay, i think i understand it.

Just to clarify.
When i just need a Yes/No Hit detection,
i would set "Loop" and "Finished" to the same Event (Yes Hit), Right?

Thanks,
Matthias

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GetNextSphereCastAllHit
« Reply #6 on: April 23, 2013, 02:36:24 PM »
hi,

 I guess you could, but I would actually still use a regular loop and simply never come back to the state, then it's easier. it' only goes to the next hit if you come back to the state with that action after the LOOP event has been fired, that's all,

bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: GetNextSphereCastAllHit
« Reply #7 on: April 23, 2013, 04:43:22 PM »
Hmm, then this will not work for my purpose. I just have to check for free ways.
I loop through all holes (4) and balls (9 per player) on a table with "get next child" so i have to definitley come back to the state quiet often....

You didnt add a simple "HIT" Event. So you can only use Loop Event for that.

Looping through the results is not necessary and not wanted in my case. so i have to disable/reset that feature somehow.
« Last Edit: April 23, 2013, 04:45:44 PM by doppelmonster »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GetNextSphereCastAllHit
« Reply #8 on: April 24, 2013, 01:52:44 AM »
Hi,

 ok, I have created a regular sphereCast:

http://hutonggames.com/playmakerforum/index.php?topic=3718.0


bye,

 Jean