Not really sure what to put here but I’m learning about pathfinding and I have this dummy that should move to each waypoint but it doesn’t jump over the gap, not really sure what else to say.
Script:
local replicatedStorage = game:GetService('ReplicatedStorage')
local pathfindingService = game:GetService('PathfindingService')
local modules = replicatedStorage:WaitForChild('Modules')
local tutorialHandler = require(modules:WaitForChild('TutorialHandler'))
local path = pathfindingService:CreatePath(
{
['AgentRadius'] = 5;
['AgentHeight'] = 5;
['AgentCanJump'] = true;
}
)
path:ComputeAsync(tutorialHandler.PathWaypoints.Jump[1], tutorialHandler.PathWaypoints.Jump[2]) -- these are just vector3's
while true do
for i,v in ipairs(path:GetWaypoints()) do
workspace.Dummy.Humanoid:MoveTo(v.Position)
workspace.Dummy.Humanoid.MoveToFinished:Wait()
end
end
Tried that and the behaviour seems to be the same. The print(‘jump’) is only outputted when the dummy first goes to the jump, then it’s repeatedly outputted when it falls.
while true do
for i,v in ipairs(path:GetWaypoints()) do
workspace.Dummy.Humanoid:MoveTo(v.Position)
if v.Action == Enum.PathWaypointAction.Jump then workspace.Dummy.Humanoid.Jump = true print('jump') end
workspace.Dummy.Humanoid.MoveToFinished:Wait()
end
end
I just tried and the behaviour still seems to be the same.
I don’t think that would be the issue anyway as one path should work properly. I vaguely followed the devhub tutorial, pretty sure it’s only needed when needing to recalculate the path. Since it’s the same V3 arguments, it would return the same path anyway.
Those are the arguments to create the path instance which helps calculate the path waypoints based on the params given. Same sort of thing as TweenInfo or RaycastParams.
Maybe try setting the humanoid’s state once the action is “Jump”.
local replicatedStorage = game:GetService('ReplicatedStorage')
local pathfindingService = game:GetService('PathfindingService')
local modules = replicatedStorage:WaitForChild('Modules')
local tutorialHandler = require(modules:WaitForChild('TutorialHandler'))
local path = pathfindingService:CreatePath(
{
['AgentRadius'] = 5;
['AgentHeight'] = 5;
['AgentCanJump'] = true;
}
)
path:ComputeAsync(tutorialHandler.PathWaypoints.Jump[1], tutorialHandler.PathWaypoints.Jump[2]) -- these are just vector3's
while true do
for i,v in ipairs(path:GetWaypoints()) do
if v.Action == Enum.PathWaypointAction.Jump then
workspace.Dummy.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
print('jumping')
end
workspace.Dummy.Humanoid:MoveTo(v.Position)
workspace.Dummy.Humanoid.MoveToFinished:Wait()
end
end
Mhmh ok, let’s try something, remove those Params for the Create path or comment them out and remove the while true loop, and see what exactly happens.