Child actor component has authority on client

My “ArenaCharacter” (Parent: ACharacter) has a “CharacterEquipment” (Parent: UActorComponent). The “CharacterEquipment” component has a “ArenaWeapon” (Parent: AActor) called PrimaryWeapon.

When on the client and inside the ArenaWeapon class, if I check Role, the client has authority.

CharacterEquipment.h: http:///ynL3EFyS

CharacterEquipment.cpp: http:///vnpvVa84

ArenaCharacter.h: http:///KyjffMWV

ArenaCharacter.cpp: http:///qCfcERRw

ArenaWeapon.h: http:///cSYc7Anu

ArenaWeapon.cpp: http:///ah3T2JMu

If I call OnMelee() on the ArenaCharacter input (on the client) it then goes into ArenaWeapon StartMelee() where it’ll check the Role. The client then believe it has ROLE_Authority and doesn’t call the correct server function.

Hello Ky Mercer,

I have a few questions about the issue

  1. Is this a issue that recently appeared upon updating to a new version of the engine?
  2. If the previous is true, are you using 4.8, 4.8.1 or 4.8.2?
  3. If cause the StartMelee() function to be called directly instead of through OnMelee(), does this issue still occur?
  4. Does this issue happen with other functions that do this type of checking for authority or is this the only one?

I still haven’t test all the situations you listed but here is my results so far:

  1. No this issue exists on all engine versions i.e. 4.8, 4.8.1, 4.8.2
  2. This issue exists on all method that implements server functions

I started to think that this issue exists because the character doesn’t direct have the weapon rather the character has an equipment component and that component has the weapon. So when the variable “bNetUseOwnerRelevancy” is equal to true it is looking to use the components net relevancy, which if I understand correct UActorComponents don’t have net relevancy (seems they assume they have net “Authority”).

Maybe you could let me know if my thinking is correct?

Thanks so much for your help!

I believe you may be right about the fact that the UActorComponent may not have it’s own net relevancy. Could you try using GetOuter or something of the sort to get the authority of the character instead? Sometimes there are certain objects that the clients themselves own, and the weapon itself could be one of these as well which would cause this problem.

I will give that a try. I may take a while for me to get around to it. We are having an pre-alpha play test so I needed to get the game at least working. Once the play test is over I will go back and see if that fixes it. Thanks again for your help!

Sounds good. I’ll be marking the question as resolved purely for tracking purposes. When you have a chance to work on this issue again, please comment with your results and the question will reopen.

Have a good weekend,