I am trying to figure out what I am doing wrong here, since I was following a tutorial and it seemed to work perfectly fine for him. I don’t know if it is because I am using a remote event or what. For context I am trying to make a tutorial sequence and I am setting up for the ‘teacher’ character to go to a specific spot.
local tutStart = game.ReplicatedStorage.TutorialStart
tutStart.OnServerEvent:Connect(function(plr)
local pathfindingService = game:GetService("PathfindingService")
local humanoid = script.Parent.Humanoid
local body = script.Parent.UpperTorso
local path = pathfindingService:CreatePath()
path:ComputeAsync(body.Position, game.Workspace.PathfindingDestination.Position)
local waypoints = path:GetWaypoints()
for i, waypoint in pairs(waypoints) do
humanoid:MoveTo(waypoint.Position)
humanoid.MoveToFinished:Wait(1)
end
humanoid:MoveTo(game.Workspace.PathfindingDestination.Position)
end)
Here is an example of what it is doing, it isn’t going around the wall, just straight into it. Any help will be greatly appreciated, thank you in advance!