Execute code while switching a scene?

  • #1, by stothewSunday, 01. July 2018, 13:39 6 years ago
    Hi there!

    i would love to execute code while switching the scene.

    An easy example would be playing the sound of an closing door.
    it should play at the time the screen is black, but if i just put it after "switching the scene" it plays to late. (i don´t want to make the fade longer with my own "black fade" after the transition.

    Any other idea how to solve this?

    Thanks!

    Forum Fan

    127 Posts


  • #2, by afrlmeSunday, 01. July 2018, 13:42 6 years ago
    It should play instantly on the next scene change. Does the sound play instantly in the audio recording or is there a delay before it actually plays?

    Imperator

    7278 Posts

  • #3, by stothewSunday, 01. July 2018, 13:59 6 years ago
    if the new scene is displayed the door is already closed.
    so it should play before the screen begins to fade to the new scene (while black).  i cut the sound so (at the moment) it plays instantly at play action. (but this happens after scene is fully loaded / visible, which is too late)
    it´s not that much delay, but noticeable because the the door in the new scene is already closed.

    Forum Fan

    127 Posts

  • #4, by afrlmeSunday, 01. July 2018, 15:57 6 years ago
    Did you try adding a short pause in the action block before playing the sound?

    Also, quick note: scripts & actions & so on are paused when fading between scenes. They only carry on if scene is changed immediately.

    Imperator

    7278 Posts

  • #5, by stothewSunday, 01. July 2018, 17:30 6 years ago
    Ah, got it!
    you can trigger another action this one goes on even when the scene is fading.

    Thanks.

    Forum Fan

    127 Posts