Search Unity

HLAPI CRC channel count error

Discussion in 'Multiplayer' started by xXApOXx, Jul 13, 2015.

  1. xXApOXx

    xXApOXx

    Joined:
    Feb 9, 2015
    Posts:
    76
    Hi guys,

    I'm stuck with this weird error : HLAPI CRC channel count error.

    I figured it out that it was that script that didn't match on client side :

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using UnityEngine.Networking;
    5.  
    6. public class FoesSpawner : NetworkBehaviour {
    7.  
    8.     [SerializeField]
    9.     private GameObject foePrefab;
    10.  
    11.     [SerializeField]
    12.     private Transform target;
    13.  
    14.     //Components
    15.     private Transform myTransform;
    16.  
    17.     // Use this for initialization
    18.     void Start()
    19.     {
    20.         //Components
    21.         myTransform = this.GetComponent<Transform>();
    22.     }
    23.  
    24.     // Update is called once per frame
    25.     void Update()
    26.     {
    27.         if (Input.GetKeyDown(KeyCode.O))
    28.             CmdSpawnFoe();
    29.     }
    30.  
    31.     [Command]
    32.     private void CmdSpawnFoe()
    33.     {
    34.         Debug.Log("Test");
    35.  
    36.         GameObject newFoe = (GameObject)Instantiate(foePrefab, myTransform.position, Quaternion.identity);
    37.         NetworkServer.Spawn(newFoe);
    38.  
    39.         newFoe.GetComponent<FoeMovements>().CmdTransmitTarget(target);
    40.     }
    41. }
    42.  
    If I log something on the Update(), I can read it, client or server side but the "Test" log on the command don't appear on the client side...

    I can't understant what is wrong, it's a simple gameobject with a NetworkIdentity. The target has a NetworkIdentity as well. The FoePrefab too. No "Server only" checkbox is true on the inspector. And the Foe does appear on both side when I Press "O" on the server application. And all foes move to the target after that...

    THX !