Forum rules - please read before posting.

Variable: Check does not work

edited August 2016 in Technical Q&A
Hi.

I want to do following:
When I get a record in scene A, a part of scene B is changing (red_background appears).
So I defined a global variable (Variable_set_red). And when I get the record, the variable changes from false to true and keep the status when I go scene B.

I created an ActionList in scene B to change the scene:
image

When Variable_set_red is true, red_background appears.
For that I gave red_background a Remember Visibility-Script and set it to off.
image

But the ActionList doesn't work.

1) I'm not sure what to do with If condition is not met:
Is that right, as I've set it up?

2) red_background works properly when I activate it with a simple hotspot.


How can I solve this?
Thanks.

Comments

  • Ummm... first make sure your global variable is set to false by default in the variables manager. If the option is true by default that may be getting in the way. Also, just in case, try checking Retain in prefab in the remember visibility script. 

    By the way, where are you putting the actionlist in scene B? Is it on the OnStart actionlist slot?
  • From what you've shown, it all looks OK - but as the sprite will be invisible by default, you don't need Action #2 unless it's possible for the player to turn the variable to False again.

    As @Alverik asks, at what point is the ActionList run?  Try testing it out in-game by clicking "Run now" in its Inspector - as we'll need to know if the problem is that it's not running or not.

    What do you mean by activating it with a simple Hotspot?  Which Action specifically are you running?

    Also check the state of the variable itself.  View it in the Variables Manager while the game is running, and check "Show realtime values".  Is its value changed to True at the correct time?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.