Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Network Command Problem

Discussion in 'Multiplayer' started by CoMANDOR, Sep 21, 2015.

  1. CoMANDOR

    CoMANDOR

    Joined:
    Sep 21, 2015
    Posts:
    8
    I want to convey to the variable t server so that it is also currently use this variable. But still not sent to the server at all. Not even performs the Command. Something is not right to do?
    Code (CSharp):
    1. void Update()
    2.     {
    3.         if(!netObj.isServer)
    4.         t += Time.deltaTime;
    5.         if (isLocalPlayer)
    6.         {
    7.             testOk = true;
    8.             CmdToServer(t);
    9.         }
    10.        
    11.        
    12.        
    13.     }
    14.     [Command]
    15.     void CmdToServer(float i)
    16.     {
    17.  
    18.             testOk = true;
    19.             t = i;
    20.        
    21.         //RpcSendToServer(time);
    22.        
    23.     }
    Command when calling the server writes: Unknown message ID 12 ConnID: 1. The internet did not find how to fix. Who knows, help!!!
     
  2. CoMANDOR

    CoMANDOR

    Joined:
    Sep 21, 2015
    Posts:
    8