why is this happening when trying to path find a player model to a point
(player is the origin spot, the node is the end spot.:
CODE:
local path = PathfindingService:CreatePath(
{
AgentRadius = animatronic.HitBox.Size.X / 2;
AgentHeight = animatronic.HitBox.Size.Y;
AgentCanJump = false;
AgentCanClimb = false;
WaypointSpacing = 0.5;
}
)
local success, errorMessage = pcall(function()
path:ComputeAsync(animatronic.PrimaryPart.Position, PointsOfInterest.ToyChica["1"].Position)
end)
if success and path.Status == Enum.PathStatus.Success then
for _, waypoint in path:GetWaypoints() do
local part = Instance.new("Part")
part.Position = waypoint.Position
part.Size = Vector3.new(0.5, 0.5, 0.5)
part.Color = Color3.new(1, 0, 1)
part.Anchored = true
part.CanCollide = false
part.Parent = workspace
task.wait(0.05)
end
else
print(`Path unable to be computed, error: {errorMessage}`)
end