I am making a Selfdriving car that uses roblox pathfinding this is what my car is it is just a body of a car but a torso on the body the body is just the chassy of the car the "Torso" is welded on the "Body" i asked an question here https://scriptinghelpers.org/questions/116925/a-pathfinding-algorithm-seems-to-not-work-for-bigger-torso and a kind person replied with:

local pathfindingService = game:GetService("PathfindingService")
local humanoid = script.Parent.Humanoid
local body = script.Parent:FindFirstChild("HumanoidRootPart") or script.Parent:FindFirstChild("Torso")
local destination = game.Workspace.Destination.Position


local pathParams = {
    ["AgentHeight"] = 5, --The height of the character
    ["AgentRadius"] = 2, --The width of the character from end of left arm to right arm times half.
    ["AgentCanJump"] = true --Can the character jump?
}

local path = game:GetService("PathfindingService"):CreatePath(pathParams)

path:ComputeAsync(body.Position, destination)
local waypoints = path:GetWaypoints()
for k, waypoint in pairs(waypoints) do
    humanoid:MoveTo(waypoint.Position)
    if waypoint.Action == Enum.PathWaypointAction.Jump then
        humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
    end
    humanoid.MoveToFinished:Wait()
end

so i am just using the code the person send.

i also made my work Open Source if you want to help fix this:

https://web.roblox.com/library/6064394041/car-OPEN-SOURCE

1 comment

0

i used moon animator's easy weld to weld the torso to the body