How to Kill one bird with one stone
amigoni
Member Posts: 78
Need help with this. I have a rule that if I touch an actor inside. It dies. But if two actors overlap they both die. How can I make it so that only one of them dies?
Even better. How can I check that one actor doesn't overlap too close to another one. Right now my actors sometimes re-spawn at exactly the same location. So I can't tell how many there are. I do have a random generator going but if they are killed at the same time they get the same variables to be re-spawned to.
Thanks
Leo
Even better. How can I check that one actor doesn't overlap too close to another one. Right now my actors sometimes re-spawn at exactly the same location. So I can't tell how many there are. I do have a random generator going but if they are killed at the same time they get the same variables to be re-spawned to.
Thanks
Leo
Comments
Create a boolean actor variable and call it "Touched"
Then add a rule:
When actor receives event touch is pressed
--Change attribute self.touched to true
When attribute self.touched is true
--Destroy actor
I donno if this will actually help or not cuz im not at home to test out, but its worth a shot
-Kyle
Just as a note. It is better to use an integer as a switch since as you touch the variable will keep switching between true and false with the bolean.
Take the touch away from the big one and you now have a touch area smaller than the actual actor. Obviously this will use more resources, but ok if you don't have too many actors.