Tower Defense Simulator / Tower Battles - How zombies work with a path?

I am not sure if this is right topic for this, but I am talking about how zombies work with a path, I never done this, I would like to get an some idea how this may work.

Paths
Explorer

Zombie walking through the path

Zombie files
ZombieExplorer

All files are made by @BelowNatural, got it from his profile creations with a permission.

I have no idea how this works, does this use PathFindingService and I wonder how zombie walks and rotates through without Humanoid.

4 Likes

I am confused. What’s the harm of having a humanoid?

1 Like

There is no harm, I am asking how the zombie is moving through the path (including rotating in direction)

I didn’t make it, so I’m not exactly sure, but I assume it’s a combination of (possible tweening?) SetPrimaryPartCFrame with the CFrame looking at the next waypoint and moving towards it.

Again, I didn’t make it. I’m not sure. You’d have to ask who made it.

They use animation, I think CFrame would break animation

Are you absolutely sure humanoids aren’t used? Either way, if you’re trying to replicate it you’re better off using a humanoid. I can help you with path finding with that, but only the people who made that zombie know the answer to your question.

After examining align orientation and align position, it appears that attachment 0 and 1 should be set to the npcs attachment and the node attachment. That will make the NPCs travel to that attachment.

1 Like

You are perfectly right, zombie travels to the node. That’s really useful!

Does that work? Or is the orientation off slightly?
If the orientation looks off, set the align orientation attachment 1 to the node BEFORE the next one.

If it works fine, then great! All you have to do is use a magnitude check to determine when to switch to the next node.

local nodePart = --Define
local rootPart = --Define root

if (nodePart.Position - rootPart.Position).magnitude <= 0.1 then
    print('Within 0.1 studs of destination')
end
6 Likes