RealDocs

AActor::IsBasedOnActor

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: virtual

Description

Iterates up the movement base chain to determine whether this actor is based on (standing on or riding) the given actor. Defaults to checking the attachment chain.

Caveats & Gotchas

  • The default implementation delegates to IsAttachedTo, but character movement overrides this to walk the movement base chain separately. If you have custom base tracking, you must override this method — do not rely on attachment alone.
  • Passing null for Other will return false without asserting, so null checks before calling are unnecessary but harmless.

Signature

virtual bool IsBasedOnActor(const AActor* Other) const

Parameters

Name Type Description Default
Other const AActor* The actor to test whether this actor is based on.

Return Type

bool

Example

Check if a pawn is riding a platform actor C++
APlatformActor* Platform = GetPlatform();
if (SomePawn->IsBasedOnActor(Platform))
{
    // Pawn is standing on the platform — apply platform velocity
    SomePawn->AddMovementInput(Platform->GetVelocity() * DeltaTime);
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.