APawn::GetMoveGoalReachTest
#include "GameFramework/Pawn.h"
Access: public
Specifiers: virtualoverrideconst
Description
Part of the `INavAgentInterface`. Provides the goal geometry used by the AI pathfinding system to determine when a moving actor has reached this pawn.
Caveats & Gotchas
- • Output parameters are set by this function and consumed by the navigation system — do not call this directly in gameplay code; it is invoked by the pathfinding system.
- • If your pawn has an unusual collision shape, override this to return accurate extents; using the wrong radius/height can cause AI to stop too early or too late.
Signature
virtual void GetMoveGoalReachTest(const AActor* MovingActor, const FVector& MoveOffset, FVector& GoalOffset, float& GoalRadius, float& GoalHalfHeight) const override Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MovingActor | const AActor* | The actor attempting to reach this pawn's location. | — |
| MoveOffset | const FVector& | Desired offset from the goal location at which to consider the move complete. | — |
| GoalOffset | FVector& | Output: offset applied to this pawn's location to produce the actual goal position. | — |
| GoalRadius | float& | Output: acceptance radius in the horizontal plane. | — |
| GoalHalfHeight | float& | Output: acceptance half-height in the vertical axis. | — |
Return Type
void Example
Override to tighten reach test for a small pawn C++
void AMySmallPawn::GetMoveGoalReachTest(const AActor* MovingActor, const FVector& MoveOffset,
FVector& GoalOffset, float& GoalRadius, float& GoalHalfHeight) const
{
Super::GetMoveGoalReachTest(MovingActor, MoveOffset, GoalOffset, GoalRadius, GoalHalfHeight);
GoalRadius = 30.f;
GoalHalfHeight = 20.f;
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?