#Is there something wrong with how I'm calling to clients

1 messages · Page 1 of 1 (latest)

frosty sinew
#

I called to my ServerRpc function from the server. And then I'm trying to give information to all my clients. Only my host updates, my other clients don't get any calls.

#

And this is how I call to my Server function

frigid hearth
#

Assuming each client is going to call that function to tell the Server their name

frosty sinew
#

Well I thought I could have it so that just the server calls it and then sends it to every other client. Is the only way to have all the clients call it?

#

Because I want in the future to be able to have the server send commands to every other client

frigid hearth
#

ServerRpc is for clients to request the server to run a function. ClientRpc is for the server to request all clients to run a function.

#

So it seems like you’re kind of mixing approaches up. If you just want the server to handle things, you don’t need a ServerRpc. Just check for IsServer and call your ClientRpc.

frosty sinew
#

How do I call my ClientRpc correctly

frigid hearth
#

You just call it on the server.

frosty sinew
#

So this should work

frigid hearth
#

Yeah. Nothing wrong with the syntax. I’m not sure where you want it called from or what your desired outcome is, so I can’t really help with the logic.

#

You’re also using the legacy Rpc attributes. I would suggest using the new ones as they provide more flexibility and are clearer in who they’re sent to.

frosty sinew
#

Gracias, yeah I'm getting back into the multiplayer aspect of this after like over a year notlikethis