Forum rules - please read before posting.

Saving inactive gameobjects

edited November 2017 in Technical Q&A
So I started using AC's save system but I'm running into problems with inactive public gameobjects. I attach them from editor and they are all set and working on the start of the game:

imagehttps://imgur.com/KXPpmub

then I quit to the main menu (main menu is a diff scene and quit does the AC autosave), after I load that autosave my inactive public gameobjects are not assigned anymore.


I was using workarounds like :
focusPointMenu = GameObject.FindGameObjectWithTag("FocusPointMenu");
but FindGameObjectWithTag is a heavy function witch I would like to avoid as much as I can. Is there another option for this?

Comments

  • I'm not sure where AC is contributing to this - your images only refer to a custom component.  Are you attaching any Remember components to the GameObjects in question?

    But Unity in general has issues when it comes to working with inactive GameObjects at runtime - I recommend to avoid disabling things whenever possible.  What do the GameObjects actually do?  It would likely be better to instead disable their components, or script their deactivation into the code itself.

    A tutorial on writing custom Remember components can be found here.
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.