playMaker

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

Adam Z

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Is there a Wait until Variable is populated?
« on: April 27, 2017, 07: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: 732
    • View Profile
Re: Is there a Wait until Variable is populated?
« Reply #1 on: April 27, 2017, 09:41:59 AM »
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).