while true do path = game:GetService("PathfindingService"):ComputeRawPathAsync(game.Workspace.Start.Position, game.Workspace.Finish.Position, 512) points = path:GetPointCoordinates() game.Workspace.Points:ClearAllChildren() for i=1, #points do part = Instance.new('Part') part.Size = Vector3.new(1,1,1) part.FormFactor = Enum.FormFactor.Symmetric part.CanCollide = false part.Position = points[i] part.Anchored = true part.Parent = game.Workspace.Points end wait(0.1) end
my roblox studio crashes when i use this script. everytime i try to move my finish to a different position or add a part my studio crashes. why?
I'm sorry I don't know if what I am about to say is going to fix your problem completely since I don't really know what you have in the workspace or inside of your game. However, try putting a wait()
inside of the for loop and see if that changes anything if not then I am not sure as to why it would do that...
Thank you and sorry I couldn't help you any better.
~~KingLoneCat