- Home /
[UNET] Calling a function on a specific Client
After hours of google searching and testing out i dont find the right answer. Can someone tell me how i can call a function on a specific Client from server with the new network system like an RPC and the networkplayer with the old network system? i know about the NetworkServer.SendToClient(), but it doesnt seem right or i dont understand it correctly...
Answer by Sha644 · Jul 19, 2015 at 11:09 AM
Hello, as I see no one answered the question so let me help you a bit. As I see you have the same problem that I had. First way to do what you want is at begining use NetworkServer(and NetworkClient).RegisterHandler(), and then you will be able to use SendToClient(). There is a good example how it works here
Hope this will help you.
Thanks for the link, I'd been trying to find some up to date $$anonymous$$aster Server information but lately searches are turning out a bit thin for some reason, on the latest content.
Answer by ShawnFeatherly · Apr 05, 2017 at 01:42 AM
There's a newer, Unity3D 5.4, attribute that's made for this called [TargetRpc] https://docs.unity3d.com/ScriptReference/Networking.TargetRpcAttribute.html
Your answer
Follow this Question
Related Questions
RPC is called but it doesn't destroy some GameObject instances 1 Answer
RPCMode.Server works in one spot but not another 0 Answers
Using .SetActive() over Unity Network for multiplayer. (Enable weapons on clients) 1 Answer
Networking between projects: how to send ViewIDs? 1 Answer
Rpc is received by client but Cmd is not received by server 2 Answers