UCharacterMovementComponent::CanStepUp
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Returns whether the character is currently allowed to step up onto the actor or component recorded in the given hit result.
Caveats & Gotchas
- • Returns false unconditionally while MovementMode is MOVE_Falling, even if the hit component would otherwise allow stepping up.
- • Delegates to UPrimitiveComponent::CanCharacterStepUp() and AActor::CanBeBaseForCharacter() — overriding this without calling those checks can let characters step onto surfaces explicitly flagged as non-steppable.
Signature
virtual bool CanStepUp(const FHitResult& Hit) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Hit | const FHitResult& | Hit result identifying the actor/component to test. | — |
Return Type
bool Example
Block stepping onto tagged actors C++
bool UMyCharacterMovementComponent::CanStepUp(const FHitResult& Hit) const
{
if (Hit.GetActor() && Hit.GetActor()->ActorHasTag(TEXT("NoStepUp")))
{
return false;
}
return Super::CanStepUp(Hit);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?