How to delete an actor as you execute the pause game behaviour?

Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

Hello, I'm trying to delete an actor as I execute the pause game game behaviour, so as the pause game happens I want an actor to be deleted.
Thank you

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Okay... what have you tried? :)

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    Okay... what have you tried? :)

    I did, when I do pause game, I also put destroy this actor.

  • A_ConstantinA_Constantin EnglandMember Posts: 79

    Create a paused? boolean equal to False
    --IN PAUSE BUTTON--
    When pause button is touched, change attribute paused? to True
    When paused? = True, pause game behaviour
    --IN ACTOR TO BE DESTROYED--
    When paused? = True, then destroy actor

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @A_Constantin is right but you might need a timer to allow the destroy actor behavior to run before the game is paused:

    When Touch is Pressed
         Change Attribute game.paused to true
         Timer after 0.1 seconds [run to completion checked]
              Pause Game

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Mayhem_MadnessMayhem_Madness Member, PRO Posts: 168

    @tatiang said:
    A_Constantin is right but you might need a timer to allow the destroy actor behavior to run before the game is paused:

    When Touch is Pressed
         Change Attribute game.paused to true
         Timer after 0.1 seconds [run to completion checked]
              Pause Game

    Hi, thankyou, that worked for me. Sorry for the late reply.

Sign In or Register to comment.