Hi.
Not a great idea to use Globals for that
Maybe you can try this :
When raycasting, get the object that is hit in a variable 'EnemyHit' (for example).
Then use a tag switch or tag compare on the 'EnemyHit'.
If it has a 'Enemy' tag then you can do this (for example) :
"Set Fsm int", 'EnemyHit' (Target) , 'HitDamage' (variable) : set a certain damage you wish to give to the enemy (depending on weapon)
Then
"Send Event By Name", 'EnemyHit' (Target) , 'DoDamage' (Event)
On the Enemy have a Transition named 'DoDamage' (all enemies should have the same event name, also the event does not need to be set to global)
Deduct the 'HitDamage' and check if enemy health is 0 or below then die or not die.