Ragdoll Physics on Death

If u changed the delegate, did u also change the function bound to the delegate to add the extra parameter?

I think the main problem is the OnTakeAnyDamage delegate which comes from AActor, but does not contain the DamageEvent parameter, so even when u extend your OnHealthChanged delegate, u have no access to the DamageEvent at all.

What u can do is remove the OnTakeAnyDamage delegate from the HealthComponent BeginPlay, override the TakeDamage on your character and any other actor that have a health component and inside this method, call your TakeDamage method on the health component.



float ATPSCharacter::TakeDamage(float Damage, FDamageEvent const& DamageEvent, class AController* EventInstigator, class AActor* DamageCauser)
{
    const auto DamageTypeCDO = DamageEvent.DamageTypeClass ? DamageEvent.DamageTypeClass->GetDefaultObject<UDamageType>() : GetDefault<UDamageType>();
    HealthComponent->HandleTakeAnyDamage(this, Damage, DamageEvent, DamageTypeCDO, EventInstigator, DamageCauser);
    return Damage;
}

void ATPSCharacter::OnHealthChanged(UTPSHealthComponent* OwningHealthComp, float Health, float HealthDelta, **FDamageEvent const& DamageEvent**, const class UDamageType*DamageType, class AController* InstigatedBy, AActor* DamageCauser)
{
}

void UTPSHealthComponent::HandleTakeAnyDamage(AActor* DamagedActor, float Damage, **FDamageEvent const& DamageEvent**, const class UDamageType* DamageType, class AController*InstigatedBy, AActor* DamageCauser)
{
    OnHealthChanged.Broadcast(this, Health, Damage, **DamageEvent**, DamageType, InstigatedBy, DamageCauser);
}