PlayMaker Help & Tips > PlayMaker Help

How to check for a FSM of a specific name on an object

(1/1)

MrAdventure:
Hi there,

I just want to make sure that I'm not calling "Enable FSM" on an object that doesn't have the specific one.

Thanks,

Victor

Alex Chouls:
Enable FSM has an Fsm Name field that you can use to target a specific FSM on the GameObject. Or do you mean something else...?

MrAdventure:
That is what I meant. The situation is that I am using it with mouse picks, and sometimes items are clicked that do not have a mouse click listener FSM. This throws an error, which I was trying to eliminate by first checking to see if the called FSM exists.

Victor

Alex Chouls:
Ahh, I see what you're saying.

Looking at the source code for the action I'm note sure if not finding the FSM should actually be an error...


--- Code: ---// TODO: Not sure if this is an error condition...
LogError("Missing FsmComponent!");
--- End code ---

For now you could just comment out the LogError:


--- Code: ---// TODO: Not sure if this is an error condition...
//LogError("Missing FsmComponent!");
--- End code ---

But we probably also need an action like FindFsmByName... letting you decide what to do if an Fsm doesn't exist on a GameObject. I'll double check that someone hasn't already made a custom action for that...

MrAdventure:
Thanks, I'll just let this one sort itself out then.

Victor

Navigation

[0] Message Index

Go to full version