PlayMaker Help & Tips > PlayMaker Help

Check if a game object has an FSM named "Banana" [SOLVED]

(1/1)

Fat Pug Studio:
Hi guys,

i have an FSM which is present in some object and in some not (let's call that FSM "Banana"), but every object has an FSM which needs to check if the object has FSM named "Banana" or not on itself so it can continue doing it's stuff.

Any idea on how to do this? I suppose Has Component should do, but i probably got some more stuff to write in the component field since there are few FSM's on that object.

djaydino:
Hi,
Get component will get the fsm component but not the fsm name.
So maybe a different way can be used.

I have tested a bit with "get/set fsm" actions, and "send event" actions here is my result.

If the Fsm "Banana" exists it will get the variable if the variable name is available.
If the variable name is not on the fsm, there is no result.

If the Fsm "Banana" does not exists it will check only to the 1st Fsm.
If the variable exists the other fsms are ignored.
If the variable exists it will get the value.


For 'Send event by name' :
If an fsm name is set then it will only send the event to the named fsm.
If fsm name is empty it will send to all fsms (can be helpful is some cases)

same goes for 'Send Event' but you 1st need to select one Fsm to set the Variable and then erase the fsm name.

Gustav:
There is also a GetFsmName action on the Ecosystem. :)

Fat Pug Studio:
Hmmm, i just checked it out on ecosystem. Ok, i can get an fsm name, but  how will that help me? I'm afk btw so i'm a bit senseless :D

Fat Pug Studio:
I figured it out in the end, thanks for directions and help  ;D

Navigation

[0] Message Index

Go to full version