Hello, i’m trying to follow this Offical Tutorial and running into the following problem ( in short Role is private ) :
My class inherits the ACharacter class which also inhertits AActor. Due to the Tutorial i can use the Role Variable to check if i am on the server like this Role == ROLE_Authority ;
When doing so i get an error that says Role is a private member of AActor and therfore i cant use it like this.
When searching trough the AActor class i could found there is a GetLocalRole() function which returns Role . But i am still confused because i am follwoing an tutorial for the same Version and am still wondering if i did something wrong or if Role has set private due to Encapsulation and GetLocalRole() is the new way to go
In previous versions you would do if (Role == ROLE_Authority), but that’s a protected member now.
So instead you gotta GetLocalRole(), or RemoteRole(), which return ENetRole.
Or directly HasAuthority() which returns a bool.