APawn::GetMovementBaseActor
#include "GameFramework/Pawn.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the owning Actor of the movement base component the pawn is currently standing on or attached to. Returns null if the pawn is not based on anything.
Caveats & Gotchas
- • This is a static helper that calls GetMovementBase() on the pawn and then gets the component's owner — if you need the base component itself (not just the actor), call GetMovementBase() directly instead.
- • Returns null for pawns whose GetMovementBase() returns nullptr, such as base APawn which always returns nullptr; you must override GetMovementBase() in your subclass (ACharacter does this) for the result to be non-null.
Signature
static ENGINE_API AActor* GetMovementBaseActor(const APawn* Pawn); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Pawn | const APawn* | The pawn whose movement base actor to retrieve. | — |
Return Type
AActor* Example
Check if pawn is standing on a specific actor C++
AActor* Base = APawn::GetMovementBaseActor(MyPawn);
if (Base && Base->ActorHasTag("MovingPlatform"))
{
// Pawn is riding a moving platform
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?