Time for action – Examining Role and RemoteRole
We'll use AwesomeWeaponUpgrade
for this.
Let's delete the combo breaker functions, but leave
PostBeginPlay
.Let's rewrite
PostBeginPlay
a bit so we can take a look atRole
andRemoteRole
:simulated function PostBeginPlay() { `log("PostBeginPlay===================="); `log("Role =" @ Role); `log("RemoteRole =" @ RemoteRole); }
Compile the code.
Run the server and the client, and then run over to the trigger to spawn the
AwesomeWeaponUpgrade
.Let's take a look at what we see on the server:
[0020.03] ScriptLog: PostBeginPlay==================== [0020.03] ScriptLog: Role = ROLE_Authority [0020.03] ScriptLog: RemoteRole = ROLE_SimulatedProxy
This is what we'd expect.
Now let's take a look at the client:
[0011.66] ScriptLog: PostBeginPlay==================== [0011.66] ScriptLog: Role = ROLE_SimulatedProxy [0011.66] ScriptLog: RemoteRole = ROLE_Authority
What's going on there?
What just happened?
If you think about it, it makes sense that the variables...