ACharacter::MoveBlockedBy
#include "GameFramework/Character.h"
Access: public
Specifiers: virtual
Description
Called by CharacterMovementComponent when the character's movement is blocked by geometry. The base implementation is empty; override to respond to movement blockage (e.g., wall-running, impact reactions).
Caveats & Gotchas
- • The base class body is intentionally empty (defined inline as `{}`), so there is no Super::MoveBlockedBy() to call — calling it is harmless but unnecessary.
- • This fires during the movement update tick, which can be called multiple times per frame in high-framerate scenarios; keep the implementation lightweight to avoid stalls.
- • Unlike OnHit delegates, this is only triggered when movement is actively blocked, not for all collision overlaps.
Signature
virtual void MoveBlockedBy(const FHitResult& Impact) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Impact | const FHitResult& | Hit result describing the blocking geometry. | — |
Return Type
void Example
Wall-jump impulse on movement block C++
void AMyCharacter::MoveBlockedBy(const FHitResult& Impact)
{
// Give a small push away from the wall
FVector Deflection = Impact.ImpactNormal * 200.f;
GetCharacterMovement()->AddImpulse(Deflection, true);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?