Question by
unity_Jjh2s_JD1gJtVQ · Jul 11, 2019 at 01:38 PM ·
scripting problemplayernetworkhostnetworkplayer
Simple Host - Client Callback
Hey Guys,
it seems a simple client-server/host problem but ich cant make it work:
At the host I want to start a procedure on a client by ClientRpc. Then when the procedure is done at the client, i want to notify the host. thats all. However ClientRpc works fine but the Command at the client gives mit no authority error. The below code happens within PlayerScript.
public void ActivateAutomatedVidScript() {
Automatize.serverProcA();
RpcStartProcess(Automatize.curClientFilePath);
}
private void OnStartProcess(string fileUrl)
{
Debug.Log("hello client");
if (!isServer)
{
Automatize.clientProcA(fileUrl);
CmdProcessDone();
}
}
public void OnProcessCompleted()
{
Debug.Log("back to server");
}
[Command]
private void CmdProcessDone()
{
OnProcessCompleted();
}
[ClientRpc]
private void RpcStartProcess(string fileUrl)
{
OnStartProcess(fileUrl);
}
Need help! Thx in advance :)
Comment
Your answer
Follow this Question
Related Questions
How can I make the camera not overreach a limit of rotation one axis. 0 Answers
Networking and RenderSettings (ambientLight) 0 Answers
Setting the playerPrefab of network manager dynamically 1 Answer
Save Stations like in Dead Space and Resident Evil VII 0 Answers
How do I make somthing happen when the Player reaches a certain x, y, z position? 0 Answers