Quick question?

hrsmediahrsmedia Member Posts: 522
edited November -1 in Working with GS (Mac)
How do you destroy an actor when a different actor is destroyed?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    To do that, you would make a global game attribute. The second actor would "listen" for it to change.

    So let's say you create a global boolean attribute called "pleaseKillMeNow"

    Right before the first actor is destroyed, set that attribute to true.

    Then in the second actor, have a Rule like this:

    Rule
    When all conditions are valid
    game.pleaseKillMeNow = true
    -----Change Attribute: game.pleaseKillMeNow To: false
    -----Destroy

    Use global attributes to 'communicate' between actors.
  • hrsmediahrsmedia Member Posts: 522
    Thanks! That worked great.
Sign In or Register to comment.