How do i get characters to move

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    a recreation of baldi from baldis basics

  2. What is the issue? Include screenshots / videos if possible!
    it just wont move. nothing blocks it.

local End = workspace.SpawnLocation.Position
local Start = script.Parent.HumanoidRootPart.Position
game["Run Service"].Heartbeat:Connect(function()
	Path = game:GetService("PathfindingService"):CreatePath({["AgentRadius"] = 4, ["AgentHeight"] = 4, ["AgentCanJump"] = false})
	Path:ComputeAsync(Start, End)
for i, way in ipairs(Path:GetWaypoints()) do
		script.Parent.Humanoid:MoveTo(way.Position)
		script.Parent.Humanoid.MoveToFinished:Wait()
	end
end)

I’m assuming you have put this in a local script and under StarterCharacterScripts. Needs to be in a server script if its going underneath the character. Copy the code into a server script and try again
:slight_smile:

Also do a wait for a few seconds to give yourself a chance to move off the spawnplate so you can actually see the monement.

its a serverscript in the character

I just copy pasted you code into a new blank game and it worked perfectly :confused:

i think i know what i did wrong. the doors are too small… i will fix.
edit: i fixed it.

Oh, didnt know you had obstacles :smile:

you can check if the npc is generating a path using pathfinding by going to
Studio Settings → Studio, scroll all the way down and turn on navigation mesh

quick question, how can i modify it to chase the nearest player? even if it hasnt finished moving? it would need to stop there… im not good at pathfinding.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.