-
What do you want to achieve?
To make a feature in my game where whenever a zombie reaches the end, it dies. -
What is the issue?
I’m not able to find a way to do it. I doubt I would find it here as it’s an out of the blue question and people wouldn’t be asking it. -
What solutions have you tried so far?
I’ve tried making the script myself. I’m trying to use a touch function but I don’t know how I would find whatever touched it and get rid of it.
You could check the magnitude between a part at the end and the zombie.
And if it’s equal to 0 it would destroy it?
Yes. Or if you want it to dies instead of destroying, use BreakJoints.
0-2 studs away from the thing would be ideal but its up to you.
Wouldn’t I have to loop through every zombie though to see how far/close they are?
I’m just wondering because there are multiple and I have them all in a folder in workspace when they’re cloned in.
Yes you would, you can quite simply just loop through the folder every x seconds to check the magnitude. However you could use a touched event to loop through the folder as an alternative.