Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A zombie that traces your movements.

Asked by 10 years ago

Instead of having a zombie chase your humanoid, how would you make it so it follows your movement, and traces everywhere you go? Like if you moved past a wall, it'd move that way too.

1 answer

Log in to vote
1
Answered by
nate890 495 Moderation Voter
10 years ago

To begin, this way of "pathfinding" is clever but it has serious downsides. Here's the most concerning one: if the player runs and then backs up and keeps doing this or just runs circles while data (essentially a vector3) is being recorded, you're going to have a pretty dumb looking zombie.

That being said, I wouldn't bother using your technique of pathfinding. Instead, I would manually set nodes around the map (I know, this sucks, but it's worth it) and use a pathfinding algorithm (A* or Dijkstra's algorithmm.) Personally, I find Dijkstra's algorithm simpler than A* but they're both relatively easy to comprehend-it's also worth it to note that A* is better performance wise. To set up nodes (and connect them to other nodes) you could make a plugin (this is what I did, anyway) but you can do it manually, it'll just take longer in the long run.

Good luck!

Ad

Answer this question