:MoveTo() Not catching up

Hello everyone ^^
To put it short: I have a loop that raycasts and does :MoveTo() so an NPC chases a player, however even when the NPC is faster it does not catch up and kind of glitch when almost at the player.

Video:

I’m not sure what to try, any help is appreciated

1 Like

intenta cambiar la velocidad del npc

You can try setting the :MoveTo() to the CFrame position of the HumanoidRootPart of the target + the CFrame.lookVector * a number which achieves your desired result.

This kind of predicts the next position of the target based upon where they’re facing.

2 Likes

It works for the most part but I have to multiply the lookVector by about 20 to make it work, on turns the NPC takes some time to turn around and the range for it being 30 makes it really easy to escape

script.Parent.Humanoid:MoveTo(HRP.Position + ownHRP.CFrame.LookVector * 20)

(deleted the “solution”) Same problem came back so I’m gonna boost this up

How frequently are you calling :MoveTo()?

It’s a repeat until loop with a wait()