AActor::TakeDamage fails when passing "this" as the DamageCauser (this is a type of AActor)

I’ve been a C# dev since it beta’d in 2000. My last deep foray into C++ was borland in the 90s so I’m learning the compiler and all of the messages it sends me so while I can read C++ easy enough and have over my career had to make edits to existing game engine code and other c++ drivers, writing it fluently is a new skill I’m learning.

The message that it was giving me didn’t make a whole lot of sense; it was after seeing the word const over and over again that I started looking for where that was before it connected with me (the const AWeapon* part - const is still a new concept for me in terms of declaring it and understanding that the function being const apparently means that the this variable inside it is also treated as a const and that that applies to its signature now)

I’m learning more and more that with Unreal you have to learn to deep dive the engine’s source code and figure out how the engine works on your own as opposed to documentation.

Thank you for the response and the summary on ApplyDamage vs TakeDamage.

1 Like