Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

hey uhh why is my pathfinding script thingy not working?

Asked by 4 years ago
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.

0
make sure that there are no anchored parts User#5423 17 — 4y
0
in your 5th variable in the beggining you accidentally put a 1 at the end karesiku 72 — 4y
0
@pixelstriko you can do that yknow speedyfox66 237 — 4y
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? karesiku 72 — 4y
View all comments (2 more)
0
^^^ yes it is like that, Phone1214 0 — 4y
0
thx kingdom5 Phone1214 0 — 4y

1 answer

Log in to vote
0
Answered by
rabbi99 714 Moderation Voter
4 years ago

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

0
They already get the position just a little bit after in the script, this won't change much. xAtom_ik 574 — 4y
Ad

Answer this question