Working on a pedestrian script and I am getting this cryptic error after running the ComputeAsync:
sabuiltin_CollisionGroupsEditor.rbxm.CollisionGroupsEditor.AssetMain.main:206: attempt to index nil with 'CurrentDataModelTypeAboutToChange'
This is the function:
function Pedestrian.new(pointsToTraverse)
local self = setmetatable({}, Pedestrian)
-- Create pedestrian model and spawn at first point
self.PedestrianModel = BasePedestrian:Clone()
self.PedestrianModel.Parent = workspace
self.PedestrianModel:SetPrimaryPartCFrame(CFrame.new(pointsToTraverse[1]))
-- Create and run path
local PedestrianPath = PathfindingService:CreatePath({
AgentRadius = 2,
AgentHeight = 5,
AgentCanJump = false
})
PedestrianPath:ComputeAsync(self.PedestrianModel.PrimaryPart.Position, pointsToTraverse[2])
local PedestrianWaypoints = PedestrianPath:GetWaypoints()
for _, waypoint in pairs(PedestrianWaypoints) do
self.PedestrianModel.Humanoid:MoveTo(waypoint.Position)
self.PedestrianModel.Humanoid.MoveToFinished:Wait()
end
return self
end
Running debug, both arguments for the ComputeAsync are valid vector3s
