playMaker

Author Topic: Is there a Wait until Variable is populated?  (Read 1393 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
Is there a Wait until Variable is populated?
« 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.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Is there a Wait until Variable is populated?
« Reply #1 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).