6#include "Components/ActorComponent.h"
8#include "KnockbackComponent.generated.h"
11class UCharacterMovementComponent;
14UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
15class CK_UE_API UKnockbackComponent :
public UActorComponent
20 UKnockbackComponent();
22 void ApplyKnockback(const FVector& Direction, const
FKnockbackData& KnockbackData);
25 virtual
void BeginPlay() override;
26 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
29 float GetKnockbackApplyTimeRatio(
bool bIgnoreKnockbackResistance) const;
30 void ApplyKnockbackVelocity() const;
31 void FinishKnockback();
35 TObjectPtr<ACharacter> OwnerCharacter =
nullptr;
38 TObjectPtr<UCharacterMovementComponent> MovementComponent =
nullptr;
41 FVector KnockbackDirection = FVector::ZeroVector;
42 float KnockbackStrength = 0.0f;
43 float RemainingTime = 0.0f;
Definition KnockbackData.h:11