Help! Bullets won't disappear after hitting enemy
Tonyu
Member Posts: 21
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
can you post a screenshot of your rules?
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Sure thing, wait.
Attributes:
Bullet Rules:
Enemy Rules:
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.
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
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
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.
Try to place your animation actor "in front of your enemy actor"
Nix the Cat: Jump Adventure * Twitter * Facebook
Thank you! I got it to work properly!