toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Quick question?
hrsmedia
Member
Posts:
522
May 2010
edited November -1
in
Working with GS (Mac)
How do you destroy an actor when a different actor is destroyed?
Comments
firemaplegames
Member
Posts:
3,211
May 2010
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.
hrsmedia
Member
Posts:
522
May 2010
Thanks! That worked great.
Sign In
or
Register
to comment.
Comments
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.