RealDocs

AActor::CanBeBaseForCharacter

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

Description

Returns whether the given pawn is allowed to walk on (be based on) this actor. Override to implement custom walkability logic per-actor.

Caveats & Gotchas

  • The default implementation returns true for all actors. Returning false here does not prevent collision — it only prevents the character movement system from treating this actor as a valid movement base, so velocity inheritance and base tracking won't apply.
  • This is called by the character movement component, not by the physics engine. A pawn can still physically stand on the actor's geometry even if this returns false; the difference is that moving-platform velocity inheritance will not apply.

Signature

virtual bool CanBeBaseForCharacter(class APawn* Pawn) const

Parameters

Name Type Description Default
Pawn class APawn* The pawn requesting to use this actor as its movement base.

Return Type

bool

Example

Prevent characters from riding a specific platform C++
bool ASlipperyPlatform::CanBeBaseForCharacter(APawn* Pawn) const
{
    // Characters cannot gain velocity from this platform
    return false;
}

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.