GameSalad

Actor collides with Actor Destroy a different Actor

Help please..

If I have 3 Actors.

Actor 1
Actor 2
Actor 3

Is it possible to destroy Actor 3 if Actor 1 and 2 are to collide?

Thanks

Comments

  • IceboxIcebox Posts: 1,390Member, PRO
    edited May 17

    yes create a boolean game attribute call it destroy
    if actor 1 collides with actor 2
    change attribute game.destroy to true

    in actor 3
    if game.destroy is true
    destroy

  • aidanshaw92aidanshaw92 Posts: 17Member

    Thanks, ill give this a go

    @Icebox said:
    yes create a boolean game attribute call it destroy
    if actor 1 collides with actor 2
    change attribute game.destroy to true

    in actor 3
    if game.destroy is true
    destroy

  • aidanshaw92aidanshaw92 Posts: 17Member
    edited May 17

    For sake of ease I will refer to my character names (character , death 1 , death 2, death 3, death 4, entrance barrier)

    The character falls from the top of the screen until it hits the 'entrance barrier' and stays in that stagnant position for the duration of the game.

    What I want to happen, is when the character hits death 1, death 2, death 3 and death 4 the entrance barrier will be destroyed and the character will keep falling.

    I created a Boolean attribute in the game, called 'destroy'

    In death 1 character

    -If 'death 1' collides with 'character'
    -- change attribute game.destroy to true

    In death 2 character

    -If 'death 2collides with 'character'
    -- change attribute game.destroy to true

    In death 3 character

    -If 'death 3 collides with 'character'
    -- change attribute game.destroy to true

    In death 4 character

    -If 'death 4 collides with 'character'
    -- change attribute game.destroy to true

    Within the 'entrance barrier' actor I create a rule that says

    • if game.destroy is true
      -- destroy actor

    is that correct??

    @aidanshaw92@googlemail.com said:
    Thanks, ill give this a go

    @Icebox said:
    yes create a boolean game attribute call it destroy
    if actor 1 collides with actor 2
    change attribute game.destroy to true

    in actor 3
    if game.destroy is true
    destroy

    @Icebox said:
    yes create a boolean game attribute call it destroy
    if actor 1 collides with actor 2
    change attribute game.destroy to true

    in actor 3
    if game.destroy is true
    destroy

  • IceboxIcebox Posts: 1,390Member, PRO
    edited May 17

    @aidanshaw92@googlemail.com said:
    In death 1 character ...

    Instead of these rules you can create a tag add your 4 actors in like this

    then in your character actor

    What I want to happen, is when the character hits death 1, death 2, death 3 and death 4 >the entrance barrier will be destroyed and the character will keep falling.

    Do you want the character to hit the 4 death actors to open the barrier or if it hits any of them ? If the character needs to hit all 4 death actors to open the barrier then this wont work

  • aidanshaw92aidanshaw92 Posts: 17Member

    Thanks

    When the character hits either of the 4 death actors, the barrier will be destroyed and the main character will continue to fall

    @Icebox said:

    @aidanshaw92@googlemail.com said:
    In death 1 character ...

    Instead of these rules you can create a tag add your 4 actors in like this

    then in your character actor

    What I want to happen, is when the character hits death 1, death 2, death 3 and death 4 >the entrance barrier will be destroyed and the character will keep falling.

    Now i didnt understand something , do you want the character to hit the 4 death actors to open the barrier or if it hits any of them ?

  • aidanshaw92aidanshaw92 Posts: 17Member

    So I have set it up as per you images.

    Struggling with what to put in the 'entrance barrier actor'

    -Rule
    --Change attribute
    ---game.destroy to true
    ----destroy actor.

    I don't think this is correct as the actor has disappeared before the game has started.

    @Icebox said:

    @aidanshaw92@googlemail.com said:
    In death 1 character ...

    Instead of these rules you can create a tag add your 4 actors in like this

    then in your character actor

    What I want to happen, is when the character hits death 1, death 2, death 3 and death 4 >the entrance barrier will be destroyed and the character will keep falling.

    Do you want the character to hit the 4 death actors to open the barrier or if it hits any of them ? If the character needs to hit all 4 death actors to open the barrier then this wont work

  • IceboxIcebox Posts: 1,390Member, PRO
    edited May 17

    Its really simple

    Character actor
    if overlaps or collides with tag death
    change attribute game.destroy to true

    entrance barrier actor
    if game.destroy is true
    destroy

    Did you do this and the actor disappeared before the game starts ? the only way it would disappear is if game.destroy is true , make sure the attribute is set to false at default :)

  • aidanshaw92aidanshaw92 Posts: 17Member

    correct! it was very simple.

    All done. Thanks for your help> @Icebox said:

    Its really simple

    Character actor
    if overlaps or collides with tag death
    change attribute game.destroy to true

    entrance barrier actor
    if game.destroy is true
    destroy

    Did you do this and the actor disappeared before the game starts ? the only way it would disappear is if game.destroy is true , make sure the attribute is set to false at default :)

  • IceboxIcebox Posts: 1,390Member, PRO

    @aidanshaw92 You welcome and good luck :)

Sign In or Register to comment.