So my police car NPC has like steering that follows the target, it works well. and my police car npc has a follow ball, which during pathfinding it gets the waypoint position making the car follow, but all it did just teleported to target instantly and not like 1 by 1 to the main target just like how Humanoid NPC’s do, but mine is a police car one.
here is pathfinding script:
while wait(0.1) do
local PathfindingService = game:GetService("PathfindingService")
-- Variables for the car and destination, etc.
local Debris = game:GetService("Debris")
local carprimary = script.Parent.Main
local destination = script.Parent.MainTarget.Value
local path = PathfindingService:CreatePath()
path:ComputeAsync(carprimary.Position, destination.Position)
local waypoints = path:GetWaypoints()
for _, waypoint in pairs(waypoints) do
local part = Instance.new('Part')
Debris:AddItem(part, 0.08)
part.Shape = "Ball"
part.Material = "Neon"
part.Name = "Pathfind_Point"
part.Size = Vector3.new(0.6, 0.6, 0.6)
part.Anchored = true
part.Parent = workspace
part.CanCollide = false
script.Parent.MainTargetOrigin.Position = waypoint.Position
end
end
What do i need to add?