You can’t reference the internals of actors that don’t exist
If you want to cast something, you need to have an actual actor reference to cast. In other words you need at least one instance of your enemy base character.
The widget will basically animate text above the damaged characters with the amount of damage. Kind of like floating above the head.
The WeaponDamage comes from the equipped Weapon. From the Trace Component I call the Weapon Damage and when a hit is detected applies damage.
Now… I am able to get this to work for my widget when it is the PlayerCharacter. I simply cast to my Player Character and the finds the weapon damage from within the TraceComponent.
I need to do the same thing coming from the Enemy but when I call to the Enemy Blueprint, the cast “fails”. My guess is I am calling from the wrong Object.
So I discovered there is still an issue. I took the suggestion of Get Actor from Class and and it first it seemed to work.
But then I realized that it only grabs the first actor but seems to ignore all the other actors of the same class. Here is the strange part. After hitting that first actor on the level, all other actors of the same class seems to work.
So I feel like I am back to trying to Cast to my BP_EnemyBase again, but to which Object ?
Just to add some more info, the reason why I am casting is that I need this variable IncomingDamage that resides on BP_EnemyBase. This is what is feeding the Floating Text numbers.
One last thing, BP_EnemyBase’s Parent class = “Character”, not “Actor”.