Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

hey uhh why is my pathfinding script thingy not working?

local PathFindingService = game:GetService("PathfindingService")
local dummy = script.Parent
local humanoid = dummy.Humanoid
local humanoidRootPart = dummy.HumanoidRootPart
local destination = game.Workspace.clinic.queuePart1
local path = PathFindingService:CreatePath()

path:ComputeAsync(humanoidRootPart.Position, destination.Position)

local waypoints = path:GetWaypoints()

for _, waypoint in pairs(waypoints) do
	local part = Instance.new("Part")
	part.Shape = "Ball"
	part.Material = "Neon"
	part.Size = Vector3.new(0.6, 0.6, 0.6)
	part.Position = waypoint.Position
	part.Anchored = true
	part.CanCollide = false
	part.Parent = game.Workspace
	
	humanoid:MoveTo(waypoint.Position)
	humanoid.MoveToFinished:Wait()
end

I'm a newbie, so forgive me, I copied almost all of this from the Roblox dev hub, but I'm not completely illiterate. According to me, this should work, but the dummy just doesn't move, at all. Pls, help.

6 comments

0

make sure that there are no anchored parts

0

in your 5th variable in the beggining you accidentally put a 1 at the end

0

@pixelstriko you can do that yknow

0

sorry, i thought that they accidentally put a 1 there and that the actual queuePart doesnt have a 1 at the end, but maybe it is like that?

0

^^^ yes it is like that,

0

thx kingdom5

1 answer

Try putting ".Position" at the end of line 5. Hope that works for you!

1 comment

0

They already get the position just a little bit after in the script, this won't change much.

This discussion is preserved as it was. New answers, comments, and votes are closed.