Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---Minis Pathfinding
- PFS = game:GetService("PathfindingService")
- --CreatePathFunction
- function CreatePath(CharRadius,CharHeight,CanJump,StartPosition,EndPosition)
- --Makes sure no arguments are missing
- if CharRadius == nil then
- local CharRadius = 2
- end
- if CharHeight == nil then
- local CharHeight = 4
- end
- if CanJump == nil then
- local CanJump = true
- end
- --Update Added this, has to be as a dictionary
- local PathArguments = {
- ["AgentRadius"] = CharRadius,
- ["AgentHeight"] = CharHeight,
- ["AgentCanJump"] = CanJump}
- local Path = PFS:CreatePath(PathArguments) --Creates Path Instance
- Path:ComputeAsync(StartPosition,EndPosition)
- --Checks To See If Path Was Found
- if Path.Status == Enum.PathStatus.Success then
- local WayPoints = Path:GetWaypoints()
- end
- --for i=1,#WayPoints do
- --Checks when it needs to jump
- --if WayPoints[i].Action == Enum.PathWaypointAction.Jump then
- --end
- --end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement