I have this meshed robot which I want to script that it moves to a part. I have tried pathfinding but the problem is that I can’t get the whole model to move on the path (only 1 part).
I’m not sure I quite understand.
You’re saying that only one part of the model is actually moving?
Can’t you just use motor6d’s or a rig editor to connect the model’s parts?
Set a primary part to the one where its child is a script that runs the pathfinding service and then weld all the other parts to the primary part. It works
local pathParts = game.Workspace.Path
local start = script.Parent.Part (this is the model)
local finish = game.Workspace.Finish (this is where I want to get to)
local PathfindingService = game:GetService("PathfindingService")
local path = PathfindingService:CreatePath()
path:ComputeAsync(start.Position, finish.Position)
local waypoints = path:GetWaypoints()
pathParts:ClearAllChildren()
for _, waypoint in pairs(waypoints) do
local part = Instance.new("Part")
part.Shape = "Ball"
part.Material = "Neon"
part.Size = Vector3.new(0.6, 0.6, 0.6)
part.Position = waypoint.Position
part.Anchored = true
part.CanCollide = false
part.Parent = pathParts
start.Position = waypoint.Position
wait(0.1)
end