Pathfinding Problem, NPC flies

Hi! I’ve been working on Pathfinding for the first time, and it was going well. Although, somehow when I start the game, the NPC now flies around everywhere with absolutely no clothes or anything. I know somethings wrong here because it’s supposed to wait 4 seconds before doing anything. Here’s an example as a GIF;

Here’s my code to help you as well,

wait(4)

-- Variables for the zombie and its humanoid
local npc = game.Workspace.Welcomer
local humanoid = npc.Humanoid

-- Variables for the point(s) the zombie should move between
local ofnum = 0
local start = game.Workspace.StartPoint
local destination2 = game.Workspace["Office"..ofnum+1]



-- Move the zombie to the primary part of the green flag model
humanoid:MoveTo(start.Position)

-- Wait until the zombie has reached its first target
humanoid.MoveToFinished:Wait()

-- Move the zombie to the primary part of the purple flag model
humanoid:MoveTo(destination2.Position)

-- Wait until the zombie has reached its first target
humanoid.MoveToFinished:Wait()

-- Move the zombie to the primary part of the purple flag model
humanoid:MoveTo(start.Position)

-- Move the zombie to the primary part of the purple flag model
humanoid:MoveTo(destination2.Position)
3 Likes

Are there any constraints on the humanoid, or anything else (like scripts) controlling it before those four seconds?

Also, that gif made me laugh, thanks for that

That is the only script controlling it as I can see.

dont even worry bout it lmao

1 Like

How about how the character is spawning? Try just running the game from the server instead of playing it like normal, and keep track of the NPC while doing it.

Yeah it just spawns in the place where it’s placed in the server naked…

1 Like

I can definitely tell that your script isn’t the culprit if the source you provided is all it is, because waiting 4 seconds in the main thread should keep the NPC in its default state of standing up and doing nothing, with clothes on, for 4 seconds.

Does disabling the script do anything, or putting the NPC in ServerStorage first?
Are there any hidden scripts doing the dirty work?

1 Like

Huh, I disabled the script and the thing still moved, so I guess you stand correct. But there’s no other scripts in the game…

Found the problem, it was because it’s R15

1 Like

I had a similar issue (not sure if it’s 100% the same):

I saw that you found the issue, but hopefully this helps in case you cannot fix it.

3 Likes