Dear Friends at Epic,
I am spawning an apex destructible BP via code this way:
ADestructibleActor* NewDestruct =
GetWorld()->SpawnActor(
SkelHeadDestructBP,
VictoryUnit->GetActorLocation() + 256 * VictoryUnit->GetActorRotation().Vector(),
FRotator::ZeroRotator,
SpawnInfo
);
I have tried Various apply damage functions, ApplyRadialDamage and ApplyPointDamage
but I cannot get a spawned apex destructible to be destroyed by C++ code
The only way I know to destroy an apex from c++, and it is quite the hacky mess, is to do the following:
-get a ref to an actual ARadialForce that exists in the level
-move this radial force via C++ to location where I spawn the apex
-fire the radial force by using a BlueprintImplementableFunction, because the ARadialForce functions are not exposed to Rocket users
I also cannot get ApplyRadialForce to work in Blueprints.
So far the only method that works for me in editor or C++ is an ARadialForce actor that has Destructible Damage specifically set.
This is very limiting!
Here are the c++ functions I’ve tried:
NewDestruct->TakeDamage(
300,
FDamageEvent(),
this,
VictoryUnit
);
TArray IgnoreNone;
UGameplayStatics::ApplyRadialDamage(
this, //world context
50, //dmg
NewDestruct->GetActorLocation(), //origin
512, //radius
UDamageType::StaticClass(),
IgnoreNone,
VictoryUnit,
this,
false //full damage
);
#Custom Damage Type
I tried making a custom damage type and setting the appropriate variables that did not work either
#Any Ideas?
Any way you know I can destroy an apex from C++ without moving around an ARadialForce and using a blueprintimplementable function due to Rocket symbol exposure limitations?
Thanks!