PowerHorse Engine
    Preparing search index...

    Hierarchy

    • Pseudo<
          {
              _activeComputationServant?: Servant;
              _customDoMoveAgentCleanupFunc?: Callback;
              _moveToFinishedListenerServant?: Servant;
              _path?: Path;
          },
      >
      • ComputedPath
    Index

    Constructors

    • Returns ComputedPath

    Properties

    Agent: undefined | ValidAgentAndDestinations = undefined
    AgentParameters: undefined | AgentParameters = undefined
    AgentTweenInfo: TweenInfo = ...

    TweenInfo in cases where Agent is not a Humanoid Character.

    AutoBlockCheckEnabled: boolean = true

    Enable custom blocked checking (Stucked checking) to determine if the Agent is stucked VIA collisions.

    AutoBlockCheckRate: number = 2
    AutoBlockCheckTime: number = 10

    How long the Agent has to be at one position to be considred "Blocked"

    Blocked: Signal<(WaypointIndex: number, InstanceThatBlocked?: Instance) => void>

    The InstanceThatBlocked is only available if BlockedRaycastParams is set or OptimizeWithRaycast is enabled and the resulting path was generated through Raycast.

    You may wish to Compute again whenever the path gets blocked, You can do this by just simply calling the Compute method. However you should always check that the blocked index was not already traversed, to prevent an unnecessary recomputation.

    ComputedPath.Blocked.Connect((WaypointIndex) => {
    if(ComputedPath.GetCurrentWaypointIndex() < WaypointIndex) {
    ComputedPath.ComputeFromCurrent();
    }
    })
    Completed: Signal<(reached: boolean) => void>
    Computing: Signal<() => void>

    Fired whenever the Compute method is called.

    DebugVisualization: boolean = false
    Destination: undefined | ValidAgentAndDestinations = undefined
    Failed: Signal<(PathStatus: PathStatus) => void>

    Fired whenever the path fails.

    FollowDestination: boolean = false

    Will continue to follow the destination while this property is true. Whenever the destinations position changes it will recompute.

    Use the FollowDestinationMagnitude property to set when change is detected

    FollowDestinationMagnitude: number = 10

    The difference of which the current position has to be from the previous position. e.g. if 10, the agent will have to move 10 studs away from their last position for recomputation to happen.

    Since the agent can now move within this magnitude without being detected, there may be cases where the Agent will stop a fair distance away from the current destination ( it will stop at the last known destination within the magnitude ). To combat this, you can implement you own recomputation logic whenever a computation as completed.

    ComputedPath.Completed.Connect((reached,noWaypoints) => {
    if(noWaypoints) {
    retun;
    }
    if(ComputedPath.GetAgentVector().sub(ComputedPath.GetDestinationVector()).Magnitude > 5) {
    ComputedPath.Compute();
    }
    }))
    IsComputing: boolean = false
    Moving: Signal<
        (
            CurrentWaypoint: PathWaypoint,
            NextWaypoint: undefined | PathWaypoint,
            IsFirstMove: boolean,
        ) => void,
    >

    Fired whenever the path is computed and the internal Move() function is called.

    PathStatus: undefined | PathStatus = undefined
    SkipBackwardsWaypoints: boolean = true

    Any waypoint that is behind the agent will be ignored.

    Unblocked: Signal<(UnblockedWaypointIndex: number) => void>
    WaypointReached: Signal<
        (
            Waypoint: PathWaypoint,
            completed: boolean,
            isLastWaypoint: boolean,
        ) => void,
    >

    Fired whenever a Waypoint is reached.

    Methods

    • Returns undefined | Humanoid

    • uses GetVector3FromItem to get Agents position

      Returns Vector3

    • Returns Vector3

    • Gets the first waypoint from the index provided

      Parameters

      • StartIndex: number
      • OptionalForwards: boolean

        Will go from Index++ instead of Index--

      • OptionalAction: PathWaypointAction

      Returns undefined | PathWaypoint

    • Parameters

      • Index: number

      Returns undefined | PathWaypoint

    • Returns PathWaypoint[]