I am trying to do something that seems very simple and straightforward: I have a Tool in my game that applies damage to an actor in the world. The tool specifies a DamageType in the ApplyDamage function, and the recipient actor receives the damage via the “Event AnyDamage” event. On my actor, I specify what type of damage affects it via a DamageType class reference variable. Then, I test to make sure the damage done is of the type that the actor should respond to.
The ApplyDamage function specifies DamageType via a class reference, but the AnyDamage Event on the actor outputs a DamageType object reference. I convert the object reference to a class reference with a GetClass function.
In this case, I have a DamageType called DAM_Axe. I only want my axe to damage things that specifically take axe damage.
But, if I test to see if those are the same DamageType, it always returns false. If I print the friendlyName of the DamageType class reference that is passed to the Actor, it always says it’s “Default_DAM_Hammer_C”, whereas the DamageType class reference on the Actor is “DAM_Axe_C”.
You can see a screenshot of the blueprint, which is extremlely simple. Am I testing DamageType the wrong way?