x

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"

TakeDamage() function always returns base damage after recieving radial damage

Been trying to convert my blueprint code to c++ and i reached a problem with receiving of radial damage . It worked perfectly in blueprint where i get the desired damage based on the distance between impact point . But in code i used the function

TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, class AActor* DamageCauser)

It always returns the base damage of the radial impact (in my case its 5000) . Im not sure whats wrong on my side . Going through the docs i noticed the below function

InternalTakeRadialDamage(float Damage,FRadialDamageEvent const & RadialDa...)

i overridden the above function but i dont get any response . I only receive the damage within the TakeDamage always returning the exact base damage (5000) . Can somebody tell me how to get radial damage properly ? much appreciated .

Thanks

Product Version: UE 4.8
Tags:
more ▼

asked Jul 28 '15 at 08:16 AM in C++ Programming

avatar image

codehawk64
68 4 7 15

avatar image staticvoidlol Jul 29 '15 at 11:01 AM

Well, looking at the implementation of TakeDamage, internally it calls InternalTakeRadialDamage only if

 DamageEvent.IsOfType(FRadialDamageEvent::ClassID)

So if you're not getting a response from the internal function I'd suspect that the damage event is not correctly specified. I'd suggest overriding your actor's TakeDamage function with the full version of Actor and setting breakpoints to see where the code branches off.

avatar image codehawk64 Jul 29 '15 at 11:11 AM

I had used the below condition to make sure the damage event i recieve is infact a radial damage . The condition returns true even though the damage is always the base damage .

if (DamageEvent.IsOfType(FRadialDamageEvent::ClassID))

I swept this problem under the rug by simply creating a c++ function getDamage() accessible through blueprint and just connecting to the EventRadialDamage node . Thanks for the reply . :)

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

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question