AShooterCharacter::TakeDamage doesn`t work

Hello, people!

In the SimpleShooter game my function(TakeDamage) doesn`t do any damege/reaction.
A tried:

  • to debug using UE_LOG, but no UE_LOG outputs;
  • recompile BP_ShooterCharacter;
  • replace enemy;
  • rebuild level;
  • restart Unreal Engine (4.26).

But still no reaactions. Please help )

Where are you calling TakeDamage?

That’s a great question. I questioned it myself, but have no idea) The main idea was to override this function from Gun.h. But still it doesn’t have it inside. We have a PullTrigger() func in Gun.cpp and inside PullTrigger() we call a TakeDamage().

Could you show the code for that?

Thanks for attention for my question, I have made a logical error: I`ve added “!” mark in statement where I should call the function :slight_smile:

I have another question: I have 2 statements

“if (HitActor != nullptr)”

and " if (HitActor) " aren`t those the same?

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms