I’ve run into a problem when coding networking fire shooting in to my game. When tried to replicate the weapon code to being able to seen by another players I got the error AActor::Role is inaccessible. After I’ve been looking forward I found the problem, In UE 4.25 and above this thing has been changed to GetLocalRole() function.
Here is my problematic chunk of code:
void ASWeapon::Fire()
{
if (Role < ROLE_Authority)
{
ServerFire();
return;
}
My question is how can I replace this statement to make my code works fine?