I’m trying to make a pathfinding system just like other tower defense games, such as Tower Battles and Tower Defense Simulator.
The Issue is my Enemies are Sliding on corners, and they also dont go along the path perfectly straight.
I have tried looking for other posts and tried searching for videos on a better pathfinding system but I couldn’t find anything, I’m new to scripting pathfinding.
So is there a better pathfinding system I can use? here’s what I am currently using.
-- Variables
local zombie = script.Parent
local waypoints = workspace.WayPoints
-- Script
for waypoint=1, #waypoints:GetChildren() do
zombie.Humanoid:MoveTo(waypoints[waypoint].Position)
zombie.Humanoid.MoveToFinished:Wait()
end
This is not path finding. You already defined the path, so all you need to do is move each humanoid to the next waypoint, and ensure they have reached the waypoint, unless they died. Take a look at this post with the same problem: Help with NPC pathfinding
Among other things I realised I had massless on, so that was the main reason why it was sliding, they still go slightly off course but its alright, thanks to everyone