Forum rules - please read before posting.

Remember component for Game Object active

Hi
I have an actionlist that enables or disables a gameobject using the Object > Call Event action to set the active state of a gameobject.

However when you reload the game, the active state isn't remembered. I've tried adding a ConstantID component to the object, and various Remember components but it doesn't get the previous Active state when reloaded.

What's the right component to add so that the Objects Active state is remembered between scene loads and game loads?

Olly

Comments

  • I seem to recall an old thread where Chris said that this isn't trivial because the remember components themselves become inactive? And in fact, the saving system is not designed to save inactive objects or those that have been removed from the scene altogether during runtime.

    If you are not dealing with a huge amount of those objects (if you are, Chris should be able to advise you further), personally I'd do something like this:

    • Create an empty gameobject, and add a 'component variable' and a 'remember variables' component to it.
    • Create a bool for each object whose status you want to track.
    • Write a short script that checks each component variable and enables/disables an associated gameobject.
  • Yeah, as I posted that I thought "hang on, with the object being disabled, will it ever work?". Odd how typing stuff out makes your brain kick in.

    I'll have a play. Thanks.

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.