Hey, guys! So I’ve been having a problem with the :MoveTo()
function. I’m using it in a NPC, and the NPC always gets close to the player, before it just never catches up. I’ve set the network owner to the server, and the walkspeed is 50 (the player’s is 24). Here’s my code and a video of my problem:
while runServ.Heartbeat:Wait() do
local target = FindTarget()
if target then
repeat
hum:MoveTo(target.HumanoidRootPart.Position+target.Humanoid.MoveDirection)
hum.MoveToFinished:Wait()
until FindTarget() ~= target or not target:FindFirstChild("HumanoidRootPart")
end
end
robloxapp-20220306-0818419.wmv (3.5 MB)
Any help is appreciated. = )