License from €75
DE EN FR ES IT CZ

Execute code while switching a scene?

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 9 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!
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 9 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?
  4. · 9 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.
  5. · 9 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.
  6. · 9 years ago
    Ah, got it!
    you can trigger another action this one goes on even when the scene is fading.

    Thanks.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?