UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a Dismemberment and ragdoll script"
// Called when the character takes damage void ACharacter::TakeDamage(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser) { Super::TakeDamage(Damage, DamageEvent, EventInstigator, DamageCauser); // Dismember the character DismemberCharacter(); // Create a ragdoll CreateRagdoll(); } // Dismember the character void ACharacter::DismemberCharacter() { // Get the skeletal mesh component USkeletalMeshComponent* SkeletalMeshComponent = GetMesh(); // Dismember the skeletal mesh SkeletalMeshComponent->DismemberSkeletalMesh(); } // Create a ragdoll void ACharacter::CreateRagdoll() { // Get the skeletal mesh component USkeletalMeshComponent* SkeletalMeshComponent = GetMesh(); // Create the ragdoll SkeletalMeshComponent->CreateRagdoll(); }