GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to destroy an actor right when another actor is destroyed?

I have two actors that overlap each other: one is the main actor, the other is the invisible actor. Whenever the invisible actor collides with an enemy actor, the invisible actor is destroyed, but I also want the main actor to be destroyed whenever the invisible actor collides with the enemy actor. I do not want the main actor to collide with an enemy actor because I'm trying to reduce the collision field of the main actor, hence the invisible actor. Only the invisible actor is the field of collision. How do I destroy the main actor when the invisible actor collides with something?

Comments

  • MoikMoik Posts: 257Member, PRO

    Try this:
    1) make a new Boolean variable "Destroyed" for the invisible actor and set it to false.
    2) At the end of the rules that destroy the invisible actor, use Change Attribute to set the Boolean to True.
    3) Add a Destroy Actor to the Main Actor where the trigger condition is Destroyed = true.
    4) In the scene reset/replay rules, just before you Create Actors again, add a Change Attribute that sets Destroyed back to False.

  • hamzawesomehamzawesome Posts: 30Member, PRO
    edited October 2015

    @Moik said:
    Try this:
    1) make a new Boolean variable "Destroyed" for the invisible actor and set it to false.
    2) At the end of the rules that destroy the invisible actor, use Change Attribute to set the Boolean to True.
    3) Add a Destroy Actor to the Main Actor where the trigger condition is Destroyed = true.
    4) In the scene reset/replay rules, just before you Create Actors again, add a Change Attribute that sets Destroyed back to False.

    I figured it out, thanks!

Sign In or Register to comment.