You’ll only be able to check the role of the class that is calling the function, meaning, whichever is calling the function; client, server, listen. I don’t believe there is a way to call down directly from the server and then check the roll of a reference, because on the server, everything is ROLE_Authority.
If you are doing this on damage of the character, this should be done on the server, so every time on “TakeDamage”, it is happening on the server and therefor, Authority.
From this point, you call down to all the clients and tell them anything, while passing the reference of what character is getting damaged / impulsed via a client function. As a note, Characters are replicated to all clients by default.
You do have access to the roles and the net modes.
Roles being:
ROLE_None,
ROLE_Authority,
ROLE_SimulatedProxy,
ROLE_AutonomouseProxy
Net modes being:
NM_Client,
NM_Standalone,
NM_ListenServer,
NM_DedicatedServer
If you checkout Actor, TakeDamage( ), there is a condition checking:
DamageEvent.IsOfType(FRadialDamageEvent::ClassID)
If this is true, it will call on all “ComponentHits”, to ReceiveComponentDamage, which in turn has 2 more conditions:
DamageEvent.IsOfType(FPointDamageEvent::ClassID)
This will add a impulse to the Actor being hit.
DamageEvent.IsOfType(FRadialDamageEvent::ClassID)
This will do a RadialImpulse, which should do impulse to anything in the “OuterRadius” of the RadialDamageEvent.
From this, it looks like the engine is setup to handle the situation of a player taking damage and getting some sort of impulse added to it on that event.