UCharacterMovementComponent::PerformAirControlForPathFollowing
#include "GameFramework/CharacterMovementComponent.h"
Access: public
Specifiers: virtual
Description
Adjusts Velocity and Acceleration to steer a falling character toward Direction while it is following a path, letting AI characters correct their trajectory mid-air.
Caveats & Gotchas
- • Only called when ShouldPerformAirControlForPathFollowing() returns true, which by default is whenever the character is in MOVE_Falling.
- • Directly mutates Velocity and Acceleration, so overriding it incorrectly can produce jittery or physically implausible falls.
- • ZDiff is a raw height difference, not clamped — a large negative value (falling well below the destination) can push air control harder than intended if you don't scale by it deliberately.
Signature
virtual void PerformAirControlForPathFollowing(FVector Direction, float ZDiff) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Direction | FVector | The desired direction of movement toward the path following destination. | — |
| ZDiff | float | Height difference between the destination and the character's current position. | — |
Return Type
void Example
Overriding for a gliding character C++
void UMyCharacterMovementComponent::PerformAirControlForPathFollowing(FVector Direction, float ZDiff)
{
if (bIsGliding)
{
Velocity += Direction * GlideAirControlStrength * GetWorld()->GetDeltaSeconds();
return;
}
Super::PerformAirControlForPathFollowing(Direction, ZDiff);
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?