Help! Bullets won't disappear after hitting enemy

Ok. I have a rule in my bullet actor to destroy itself when it collides with the enemy actor, and I also have a rule in my enemy actor to destroy itself when it collides with the bullet. Also my bullet are homing, so it also has a rule to move to enemy's x and y. The thing is, upon colliding with the enemy only the enemy gets destroyed while the bullet doesn't and stays in place.

Help please?

Comments

  • TonyuTonyu Member Posts: 21
    edited October 2014

    @jonmulcahy said:
    can you post a screenshot of your rules?

    Sure thing, wait.

  • TonyuTonyu Member Posts: 21

    Attributes:

    Bullet Rules:

    Enemy Rules:

  • TonyuTonyu Member Posts: 21

    Also something I'd like to add, not sure if this is a clue to the problem:

    When the enemy gets destroyed and I shoot more homing bullets, those succeeding bullets still home into the empty space where the enemy was.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    for the last part the problem is you're not resetting game.enemyx/y when the player dies. What I would do is set those back to 0 when the player dies. Also have a rule in the bullet that says if game.enemyx/y is 0, travel in a straight line

    for the first part I'm wondering if the rules are firing off too fast for them both to be killed. another way of looking at this would be to create an attribute called destroy or something, and have rules similar to this

    when bullet overlaps with enemy
    set game.destroy to true
    after .1 seconds
    set game.destroy to false

    then on each actor:

    when game.destroy is true
    destroy

  • TonyuTonyu Member Posts: 21
    edited October 2014

    @jonmulcahy said:
    for the last part the problem is you're not resetting game.enemyx/y when the player dies. What I would do is set those back to 0 when the player dies. Also have a rule in the bullet that says if game.enemyx/y is 0, travel in a straight line

    for the first part I'm wondering if the rules are firing off too fast for them both to be killed. another way of looking at this would be to create an attribute called destroy or something, and have rules similar to this

    when bullet overlaps with enemy
    set game.destroy to true
    after .1 seconds
    set game.destroy to false

    then on each actor:

    when game.destroy is true
    destroy

    Thanks! Gonna try that now. Yeah it seems that the rules are firing too fast because if turn off the enemy's destroy rule, the bullet gets destroyed with no problems.

    There are two things I noticed:

    1) If I set the spawn enemy death animation actor to "place in front of layer", both enemy and bullet disappear but the death animation appears above my other layers which I don't want it to.

    2) If I turn off the death animation, both enemy and bullet disappear.

  • MalkovichMalkovich Member, PRO Posts: 116

    Try to place your animation actor "in front of your enemy actor"

  • TonyuTonyu Member Posts: 21

    @Malkovich said:
    Try to place your animation actor "in front of your enemy actor"

    Thank you! I got it to work properly!

Sign In or Register to comment.