You can write your topic however you want, but you need to answer these questions:
I am using Roblox pathfinding service for a basic puncher enemy but whenever I use :MoveTo() or set the WalkToPoint, it just does not work the first time I do that, the problem is that I have a while loop which does not allow it to skip to the next waypoint position (intentional behaviour checking if NPC is close enough to its target waypoint to proceed to next waypoint).
My solution I have made is to “exercise” the :MoveTo() method by doing :MoveTo(script.Parent.HumanoidRootPart.Position) but I am trying to optimize my script to the most for the least data usage.
Also yes I have checked the Coordinates of WalkToPoint and the Position of the NPC which means it should move but it won’t, it has not gone through 8 seconds of movement to stop, it just wont move.
Had to actaully spam :MoveTo() in the for loop just for it to gaurantee movement ![]()
Does anyone know a way to make :MoveTo() work on the very first time it is used? I want to optimize my script.
local HumanoidRootPart = script.Parent.HumanoidRootPart
local Humanoid = script.Parent.Humanoid
Humanoid:MoveTo(HumanoidRootPart.Position)
local pos = Vector3.new(255, -2532, 235)
Humanoid:MoveTo(pos)