Forum rules - please read before posting.

Change Scene without DontDestroyOnLoad Objects

Hi i want to change from a AC Scene to a Non-AC Scene without loading the DontDestroyOnLoad Objects like the Player and the Persistant Engine. How can i do this? 

Comments

  • If you switch to a non-AC scene, AC will "shut down" by disabling the effects of the PersistentEngine automatically.  You can leave it safely in there.  The player prefab can then be deleted through script if you wish, or merely placed out of view - but it won't be controllable either way.

    If you use local player objects in each of your game's scenes, and don't define a Player prefab in your Settings Manager, then your player(s) won't be classified as DontDestroyOnLoad.
  • Wow, how come I don't remember ever seen that info anywhere else... pretty cool to know, though. Anyway, maybe it's time we start building a wiki page filled with tips and tricks that doesn't appear in the general documentation.
  • I tested it out. It works but feels a little bit unclean. The option to instantiate the player through the settings manager is nice. i dont want to loose this feature but for perfomance and clean scenes it is better to destory the player prefab for non ac scenes.    
    maybe you can make a toggle to the switch scene action where to destroy the gameobject. or a option in the dropdown to "switch to non ac scene" ? 
  • Why don't you just switch to a fake player before changing scenes? I've done this before when making a start screen. Basically you make a new AC player which is nothing but a cube, without a meshrender (basically invisible). Then when you want to change to scenes without a character you just switch to this invisible, lite weight, player (if the next scene was still using AC you'd constrain the fake player's movement to avoid the camera following it). Then when you return to an AC scene you go ahead a switch back to your usual Player. I know it's still a rather messy solution but it sure took away any worries about having extra stuff loading on the start screen.
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.