Multiple actors colliding with another actor
So i've got anywhere between 1 and 5 copies of this actor. Lets call him "Ball".
Each level has a various amount of balls, and my code figures out how many balls are on that particular level.
The goal of the balls is to get to another actor, which we will call "Goal"
How can I code either the balls or the goals to know when all are touching each other?
Each level has a various amount of balls, and my code figures out how many balls are on that particular level.
The goal of the balls is to get to another actor, which we will call "Goal"
How can I code either the balls or the goals to know when all are touching each other?
Comments
every time a ball actor collides with goal add 1 to the sum. When the sum = 5 then you know that all 5 balls are in the goal.
I ended up assigning an index to each ball, and then when the ball collides with the goal sets its index to 1. Then the goal constrains a seperate attribute to add up the totals of all the indexes. And when the totals equal the amount of balls, the level is complete.
And anyone who understands the above gets a virtual cookie!