What solutions have you tried so far? I checked other forums
--not all, but main part i think
if (target.Position - script.Parent.HumanoidRootPart.Position).Magnitude > 14 then
hum:MoveTo(v.Position)
end
How do I make sure that a zombie does not enter the part, but stands next to it? I tried to track the distance, but because it’s a rectangle, it has a different distance on each side.
I also tried to place attachments around, but it was laggy (zombie go to the one, then go to the second, but shouldn’t)
(I used translator, so I can have mistakes in my text)
The easiest way is to put another part that is slightly larger than the main part to check if the zombie (you can use the zombie’s humanoid root part) touched that another part and if it did then: stop it from moving
I may be wrong, but can you try something like this locally and then try to set up an equation?
so first create a target so that the rectangle you are mentioned about here
then calculate the direction in advance as I said
then write a part to pre-calculate the desired ranges
like this : target.Position - direction * num
then move the npc this direction
I think he meant how to check when the zombie should stop (check when the zombie should stop when close to the part), not how to stop the zombie from moving i think
Yes, You said that I could use the Touched function, I tried it and it would really work, but one thing is, my zombie leaves the part when a player is next to a zombie. And then how can I tell when a zombie is in the part and when it’s not?
Here is my video : https://youtu.be/YQyzdWS4hJc
Here you can see that zombie can leave my part and script wont write anything again.
Again, how i can modify it? bc if i stop the zombie, it wont go to the player.