Forum rules - please read before posting.

Issues with "Scene - Add or remove"

Hi,

ActionSceneAdd seems to not correctly remove the scene load/unload event hooks in case the scene has already been loaded.

My Setup

  • Unity 6.6 with "domain reload on enter play" off
  • Adventure Creator 1.86.7
  • Due to wanting to make scenes somewhat multi user editable I split my scene into several smaller scenes where each teammember can edit them without interfering.
  • All scenes are opened together in the editor
  • The first scene just loads all other scenes using ActionSceneAdd in OnStart.

When I enter play mode a second time without triggering a domain reload I get a "Could not find SubScene class for scene .." warning coming from ActionSceneAdd.cs:217

From the code this seems to happen because RemoveEventHooks is only called at the bottom of the Run function but "return UpdateSceneByName() / UpdateSceneByNumber()" could also return 0 e.g. when the scene is already opened because sceneChanger.AddSubScene returns false which causes run to never run again thus not calling RemoveEventHooks.

Due to how my current setup works it only causes a warning to be logged on game start but it seems that you could construct a situation where this would trigger PlayStartCutscene while loading a completely different scene if I read the code correctly.

Conditions that trigger this bug:

  • Have a scene that is already loaded be loaded through ActionSceneAdd again. The scene changer will prevent duplicate loads but the event hooks will remain.
  • Trigger another scene load of a completely unrelated scene. The scene hook from the previous ActionSceneAdd triggers.

Comments

  • edited November 18

    Welcome to the community, @billykater.

    Thanks very much for the report and detailed breakdown. I will investigate this issue,

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.