更新 Source/FLESH/Private/BloodSystem.cpp

This commit is contained in:
2025-04-21 18:00:19 +08:00
parent 2d68facb69
commit e6123f4d16

View File

@@ -151,7 +151,7 @@ UDecalComponent* UBloodSystem::ApplyBloodDecal(UPrimitiveComponent* Component, c
FRotator Rotation = (-Direction).Rotation(); FRotator Rotation = (-Direction).Rotation();
// Create the decal component // Create the decal component
UDecalComponent* DecalComponent = NewObject<UDecalComponent>(Component); UDecalComponent* DecalComponent = NewObject<UDecalComponent>(Component, TEXT("BloodDecalComponent"));
DecalComponent->SetupAttachment(Component); DecalComponent->SetupAttachment(Component);
DecalComponent->SetRelativeLocation(Component->GetComponentTransform().InverseTransformPosition(Location)); DecalComponent->SetRelativeLocation(Component->GetComponentTransform().InverseTransformPosition(Location));
DecalComponent->SetRelativeRotation(Component->GetComponentTransform().InverseTransformRotation(Rotation.Quaternion())); DecalComponent->SetRelativeRotation(Component->GetComponentTransform().InverseTransformRotation(Rotation.Quaternion()));