I have a script on a gameobject called WorldState, e.g. public class WorldState : NetworkBehaviour in this script I have a ClientRPC method, I call this and nothing happens - I have a debug inside and it never gets called. IT does however work if I throw my code on to my player class. I am not sure why it fails to work on the original? do I need to spawn in my gameobject a certain way - I just want this to live in the scene
#ClientRPC call not working
1 messages · Page 1 of 1 (latest)
ClientRpc is fire and forget...if you call it before client has player spawned, and before the thing has client in its observers, client won't get it.
im calling it on key press so not that - but thanks
You probably should just be doing the work in OnStartClient of the WorldState script instead
its not even being called on the server itself (playing host+client)
I can call the method fine if I remove the ClientRpc but of course that defeats the purpose
first, client's can't call ClientRpc
host is client
don't do that
host is a client - treat it as a remote like all the others. It needs to call a Cmd -> ClientRpc like any other client
im not sure about how to do that, I was looking at the mirror docs and just following that - I found the bit where it said ClientRPC should be used to send to clients I guess its not up to date?
It said not to use Command for this maybe same issue
do wat ??