I am making a tower defense game and everything went great until I started adding slow enemies. When the start enemies move to a point the humanoid.MoveToFinished stopped way too early and the enemies started taking shortcuts, for fast enemies it’s fine and I tried experimenting a little and nothing seems wrong with the code on my part.
I tried switching Humanoid.MoveToFinished to a Task.Wait() calculating the time it takes to move from the enemy position to the next point on the path. This worked fine for the normal enemies but for the slow enemies the wait time was right but they just moved to the point where they used to take shortcuts and then stand still until the wait ends.
This means that the Move:To is taking it to the wrong point on slower enemies but that just makes no sense to me since the speed shouldn’t matter?
One thing to note is that the slower enemies are bigger than the normal ones but the big fast ones are not glitching so it shouldn’t be any problems.
With pathfindingService:CreatePath you can use Agents like …
AgentWalkableFloorMaterial = Enum.Material.Concrete,
AgentUnwalkableMaterial = Enum.Material.WoodPlanks
Then uses these to guild the desired paths – not sure if that will help here.
When they recalculate the path, if possible they will take the shorter path.
Stopping then taking a new path = a recalculate happen before time was up to the first destination.
Sound like in this case it did not allow for enough time to complete the moveto before calling it again. If moveto works for you that’s fine. Pathfinding can give you a bit more control with Agents.
I found the issue and it’s now working, the enemies were so slow roblox thought the enemies were stuck and discarded the Move:To and fired the Move:To finished, I could simply check if the Humanoid.MoveToFinished was equal to true and if not I could restart the Move:To