ACharacter::LaunchCharacter
#include "GameFramework/Character.h"
Access: public
Specifiers: virtualENGINE_APIUFUNCTIONBlueprintCallable
Description
Applies an impulse to the character by setting a pending launch velocity that is processed on the next CharacterMovementComponent tick. Transitions the character to the Falling movement mode and fires the OnLaunched event.
Caveats & Gotchas
- • The velocity is not applied immediately — it is queued and processed on the next movement component tick. Querying velocity on the same frame will return the old value.
- • Calling this while the character is grounded causes it to leave the ground, which triggers OnMovementModeChanged. If bZOverride is false and the character already has upward velocity, the resulting Z speed can exceed expected bounds.
- • This is authoritative server-side only in a networked game. Calling it on a client will have no effect on the server simulation.
Signature
ENGINE_API virtual void LaunchCharacter(FVector LaunchVelocity, bool bXYOverride, bool bZOverride); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| LaunchVelocity | FVector | The velocity to apply to the character. | — |
| bXYOverride | bool | If true, replaces the character's current XY velocity; if false, adds to it. | — |
| bZOverride | bool | If true, replaces the character's current Z velocity; if false, adds to it. | — |
Return Type
void Examples
Knockback the character upward on overlap
Blueprint
Knockback on hit C++
void AMyCharacter::ApplyKnockback(FVector HitDirection, float Force)
{
FVector KnockbackVelocity = HitDirection * Force + FVector(0.f, 0.f, 400.f);
// Override Z to ensure upward pop, add to existing XY
LaunchCharacter(KnockbackVelocity, false, true);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?