How do i do this?

cant explain but how do i do this? using humanoid:moveto() to a part?


1.starting point
2.where i want him to go
3.where he goes

local Npc = game.Workspace["Npc here"]

local WalkPoints = {, 0, 5),, 0, 10),, 0, 15)

for _, vector in pairs(WalkPoints) do

oh the npc and part wont be in fixed positions, i just dont want to move the npc to be on top or in the part

do :

local npc -- npc

i know how to do that i just dont want it to be exactly the parts position i just want it off by a little facing the npc’s direction like shown in the pic

then do

local npc -- npc
npc.Humanoid:MoveTo(part.position +,top,Other_Side))

or u can do

npc.Humanoid:MoveTo(part.position -,top,Other_Side))

have you read the question properly?

How to make a Tower Defense Game - #1 Path Navigation - YouTube This can help

If you want the NPC to move back and forth , you can watch this AI Monster Pathfinding -Teddy Horror Game #2 - YouTube

i know how to use MoveTo() and i dont need or want pathfinding, i just need the npc to go towards the part that can be in random places but not exactly on its position

Have NPC move to an invisible brick that is positioned right near the brick you want it to go to… but script the Move to the invisible brick.

1 Like

You can do

local Distance = 4 --How far you want it to be so it isn't directly on top of part

local Direction = (NPC.HumanoidRootPart.Position - Part.Position).Unit * Distance

NPC.Humanoid:MoveTo(Part.Position + Direction)

And get something like this, where the NPC is following the player, but isn’t bumping into them.