Detecting multiple collisions
KC_Games
Member, PRO Posts: 86
How do I detect multiple collisions? I am making a game where enemies are struck with arrows that stay impaled in them. I set up an actor integer called "power" which is 2 and every time an arrow collides with the enemy, I want the power to go down by 1. If 0, destroy this actor. The power goes down to 1 when an arrow hits, but stays there and does not go below 1. I believe this is because the arrow is still stuck in the enemy and is confusing the collision detection. As you can see in image below, the enemy with 2 arrows in him should have a power of 0, but has 1. Does anyone have any ideas how to resolve this?
Comments
Create a new tag in Home/Actors and call it "spentArrow" or something. In your first rule after self.power add another Change Attribute self.Tag To: "spentArrow" make sure you open the expression editor and use the quotation marks.
You might be able to just type it in the box without opening the expression editor and without the quotation marks. I haven't tried that so I don't know if it works but it probably does.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
Thanks for the reply colander, but that did not work It still doesn't register more than one collision if an arrow is still stuck in the actor.
It worked for me in my game which spawns bullet holes if I don't change the tag it is still live and destroys any other actors it comes into contact with. It will work upload a test project and I'll take a look.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template