Endturn Button Multiplayer(Netcode for GameObjects)

I always put that, I actually never knew what it does

I even made a thread on Unity Forums but nobody answers. I created it 4 Days ago

The documentation says it allows server RPC calls by clients who don’t have RPC invocation rights. I think that means that it allows clients who are not owners to make ServerRPC calls.

And I noticed something even weirder:
So as you know it doesn‘t get called, sidenote: the void is only getting run if somebody presses a button, but if i press the button once nothing happens on client, but when I press it again it works. So really weird

Hmm interesting, if you wait 30 seconds before pressing it the first time, does that work? Or is it working based on it being pressed the first time before it works the second time? Are you testing it in Unity or in a build?

So I did diferent(sorry if its spelled wrong, not my main language) thing:

  1. I played Host only on Unity Editor
  2. I noticed these Issues, I switched so now Client on Editor
  3. I checked the logs of the build when I didn‘t play Host on Editor

Im gonna test now…

Should i record it?

So I didn‘t manage to record it because it only showed 1 window:
So what I found out was:

  1. If I press it once, I even waited, nothing happens. Only 2 Debug.Log()s (before Rpc, after Rpc. RPC TRIGGERED wasn‘t on the console and didn‘t got to run)
  2. After the second press, the same only the 2 Debugs got fired. BUT the Value that the Rpc should change got changed, but somehow the debug didnt got run

The debug didnt have any if statements or so

The debug in the RPC is probably only firing on the host, so is only visible when the host is running in the editor.

But why do I see all debugs but not this 1

But that doesnt explain why it doesnt change the value the first time and does it the second time

Well this one is specifically inside the RPC which is run on the server only.

True, maybe there is some sort of security feature for doing an action before sending an RPC? What happens if you click somewhere else, or fire a different rpc first?

so if i click anywhere else nothing happens, i didnt try making another RPC but i dont think thats the problem

It doesnt trigger as well

oh, the Host is Server + Client right? But thats only for the debug doesnt answer why it doesnt change the value. But is the expression myBool.Value =! myBool.Value right? It should switch the state

Yes the Host is a server and a client.

But is the expression myBool.Value = !myBool.Value right? It should switch the state

Privacy & Terms