Kill one and everyone dies!?

Please test this and help me with suggestions for my WIP: Little Shop of Horrace. On the opening level move (arrow keys) to the right and chop up some guys in the purple shirts (space bar). They panic and run around when they see an axe and they die after a couple whacks, but they ALL die. I only want one of them to die and the rest to run around. (same thing happens in the back room level with the flowers, but that’s more complicated). I fell like I’m missing something simple but want to get some feedback and suggestions. Please help.

Damage comes from a ray cast in the axe in the player. purple shirt guys are children of the Walk block and there’s a damage block as well.

http://www.flowlab.io/game/play/1052267

@grazer the collision trick worked. Thanks again for the help!!

Anyone? Bueller?

Hey @todorrobot - I checked out the game, but I guess you made some changes. I don’t see any of the purple shirt guys in the level. I took a quick a look at the logic, and it looks like when you send a damage message you’re sending it to “Any Object”, instead of the specific object that you’re trying to damage.

Hi @grazer, they take a second to spawn from the far right of the first level. They spawn, but then I cant tell the code which specific ibject to trigger bc it doesnt exist until it is spawned

So the real question is how do I assign a singular trigger to a spawned object? I guess I could manually place the pedestrians in the level in a long chain that loops around through the live area. But I feel like there is a solution somewhere between spawned objects and parent/child behaviors.

I think I would probably approach it without using messages - you could just use a contact trigger to initiate damage if the player contacts the enemy while the axe is swinging. Alternatively, there is a “send to last contacted object” if want to send a message to the enemy you hit. Does that make sense, or am I misunderstanding the issue?

Ive tried the last contacted option and it never seems to trigger anything. Or maybe it is contacting things before it contacts the purple shirt guy? Im having trouble tracking what the Ray cast is contacting. Is there a chance in a future upgrade that proximity radii and ray casts could be visible when live testing (playing with code visible)

Ill try the contact option and see what happens.

What confuses me is that in Zombie Beach Party when I touch a zombie they dont ALL turn to zombies, but when I axe up the pedestrians they all panic and turn into meat.