Forum rules - please read before posting.

Save GameObject presence in another scene

edited November 2020 in Technical Q&A

Hi,

let's say I have a DontDestroyOnLoad GameObject with Remember Transform component.
In a specific scene this GameObject is initiated and since then its being passed across scenes.
Is it possible to save the presence of such GameObject outside the scene where the actual GameObject is located?
That it would spawn automatically on save load.

If not, I suppose I could just remove the Remember Transform component and store the "presence state" as bool variable and then spawn it into the scene in the OnLoad event.

Is it possible to use the Remeber Transform component for such thing?
Thanks.

Comments

  • edited November 2020

    As of v1.71.0, AC will save Remember components placed on persistent GameObjects as global data - and not part of the currently-open scene.

    Such data will then only be restored when loading a save game - and not when switching scenes through gameplay, which is how Remember components normally work.

    The exception to this, however, is the Remember Transform component's Save scene presence? option - since it's no longer part of the scene.

    It will, however, save and restore the attached object's Transform, i.e. position data. While you could conceivably use a Bool to spawn it in as you describe, another option may be to have it present in all scenes, uncheck Save scene presence?, and simply keep it hidden from view until a certain point.

  • Thanks for the information, Chris.

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.