Forum rules - please read before posting.

OnStart cutscene only played once on player switching (to a player on another scene)

edited November 2018 in Technical Q&A
Whenever the player walks from one scene to another, I switch music to a song specific to the current scene. I do this using a Sound: Play music action on the OnStart cutscene for the scene and it works fine as long as the player actually walks between one scene to another. However, if I switch player to a player located in another scene (using the Player: Switch action set to "Appear in other scene"), the music is changed only the first time but not when I switch back.

This seems to be because the OnStart cutscene is only played the first time a player is switched to. Is this a bug or is this by design? If the latter is the case, when would be the right time to run the Sound: Play music action in this case?

AC: 1.65.2
Unity : 2018.2.17f1

Thanks!

Comments

  • Yes, this is by design.  When you switch to a player you've already controlled, you're not re-entering the scene but instead restoring that player's state.

    In this case, OnLoad gets called instead.
  • Ah, good to know, OnLoad should be fine.

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.