Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Adam Z on April 27, 2017, 10:59:35 AM

Title: Is there a Wait until Variable is populated?
Post by: Adam Z on April 27, 2017, 10:59:35 AM
Is there a way to wait until a variable gets populated before moving on to an event? 

I have a top level FSM Game Object that needs to be chosen by the player. I have a lower level FSM that is using a Get FSM Game Object. Since the top level might take a few moments before the player chooses, I would like the lower level FSM to wait before moving on to an Event. Is there a good node for that?

Thanks.
Title: Re: Is there a Wait until Variable is populated?
Post by: tcmeric on April 27, 2017, 12:41:59 PM
There is an action called "Game Object is Null". You can set it to everyframe, so it will keep checking. It checks to see if the game object variable has anything in it yet.


Once the variable is populated, it can send an event. Just set the "Is Not Null" event, and leave the "Is Null" to nothing. Or maybe put another state with a wait function and check back after X amount of time (if you want).