How do I use waits in functions?

  • This function should pop up a message and dissappera after 1 second. However, anything I put after the wait doesn't trigger. How can I fix this?

    * On function 'DoDebugMessage'

    * Parameter 'message' (String)

    -> DebugMessageToast: Set visibility Visible

    -> DebugMessageToast: Set text to message

    -> System: Wait 1 seconds

    -> DebugMessageToast: Set visibility Invisible

    I read elsewhere someone having a similar issue however their function seemed to just ignore the Wait. Mine seems to be having a different effect.

    Cheers

  • It seems this is happening because I am switching layouts at the same time. However, it should still work as the object is global and the event sheet it is used in still continues to run during the next layout.

    So do functions always stop running during layout changes? Or perhaps the wait actions are reset?

    Does anyone know?

    Thanks

  • I believe any pending wait actions are cancelled when you change layouts.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Don't use wait. Run a timer or fade behavior on the created object.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)