Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] DestructibleComponent::ApplyDamage & ApplyRadiusDamage not exposed to Rocket Users

Dear Friends at Epic,

I am spawning an apex destructible BP via code this way:

 ADestructibleActor* NewDestruct = 
         VictoryUnit->GetActorLocation() + 256 * VictoryUnit->GetActorRotation().Vector(),

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:


 TArray IgnoreNone;
     this, //world context
     50,     //dmg
     NewDestruct->GetActorLocation(),  //origin
     512,     //radius
     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?



Product Version: Not Selected
more ▼

asked Mar 11 '14 at 01:50 AM in Bug Reports

avatar image

ue4-archive ♦♦ STAFF
50k 3669 1999 9123

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:50 AM

The Answer

The only way to apply damage to apex seems to be two functions nestled inside of DestructibleComponent

Apply Damage and Apply Radius Damage Are Not Exposed to Rocket Users

These are critical functions, ESSENTIAL

Please Expose to Rocket Users


They cannot be called from C++ !!!!

 // Take damage
     UFUNCTION(BlueprintCallable, Category=Destruction)
     void ApplyDamage(float DamageAmount, const FVector& HitLocation, const FVector& ImpulseDir, float ImpulseStrength);
     // Take radius damage
     UFUNCTION(BlueprintCallable, Category=Destruction)
     void ApplyRadiusDamage(float BaseDamage, const FVector& HurtOrigin, float DamageRadius, float ImpulseStrength, bool bFullDamage);

Major Functionality Loss of Destructible Meshes If You Cant Destroy Them From C++

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:50 AM

Working with DestructibleComponents at Runtime

Please expose the DestructibleComponent symbols to rocket users so I have any hope of working with Apex in UE4, currently it is all walled off from me

(I'm very upset about this)



(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed May 01 '14 at 08:41 PM by Adam Davis for the following reason:

Problem is outdated

1 answer: sort voted first

The whole of the UDestructibleComponent class should have been exposed as ENGINE_API in CL 1985070. Hopefully this will fix your problem in future! Sorry for the trouble.

more ▼

answered Mar 11 '14 at 01:50 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3669 1999 9123

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 01:50 AM

woohooo thanks James!

The whole of the class!

  • Starts Salivating *



avatar image SteeleDriver May 01 '14 at 02:37 PM
 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Game|Damage", meta=(HidePin="WorldContextObject", DefaultToSelf="WorldContextObject", AutoCreateRefTerm="IgnoreActors"))
     static bool ApplyRadialDamage(UObject* WorldContextObject, float BaseDamage, const FVector& Origin, float DamageRadius, TSubclassOf<class UDamageType> DamageTypeClass, const TArray<AActor*>& IgnoreActors, AActor* DamageCauser=NULL, AController* InstigatedByController=NULL, bool bDoFullDamage=false );

Yep real nice, but we are still apparently missing a way to to Apply RadialImpulse... I attempted this with a blueprint barrel explosion, the function to radialimpulse did nothing.. And I have started digigng thru code to see why..

avatar image SteeleDriver May 01 '14 at 02:39 PM
 DECLARE_FUNCTION(execAddRadialImpulse) \
     { \
         P_GET_STRUCT(FVector,Origin); \
         P_GET_PROPERTY(UFloatProperty,Radius); \
         P_GET_PROPERTY(UFloatProperty,Strength); \
         P_GET_PROPERTY(UByteProperty,Falloff); \
         P_GET_UBOOL(bVelChange); \
         P_FINISH; \

Being the Code used in the Blueprint, it should apply this force to the actor next to it that shot it :)

avatar image Adam Davis STAFF May 01 '14 at 08:41 PM

Hi SteeleDriver,

This post is from pre-release, however your contribution is much appreciated. I will lock the comments and close the thread. Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question