Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question NGO Deffered messages warning

Discussion in 'Multiplayer' started by MajkoGaming, Nov 26, 2023.

  1. MajkoGaming

    MajkoGaming

    Joined:
    Nov 8, 2021
    Posts:
    3
    Currently working on a multiplayer tank game. I have script on each of the tanks that calls the DestroyTankServerRpc() whenever the tank health is less than 0. This works well on the client, but when the host tries to destroys a tank I get the following warning:
    [Netcode] Deferred messages were received for a trigger of type OnSpawn with key 30, but that trigger was not received within within 1 second(s).
    I was told this could be caused by an RPC not being recieved before the NetworkObject is despawned. However even if I comment the SpawnWreckClientRpc() out nothing changes.

    [ServerRpc(RequireOwnership = false)]
    public void DestroyTankServerRpc(NetworkObjectReference tank, ServerRpcParams serverRpcParams = default) {
    if (tank.TryGet(out NetworkObject tankObject)) {
    SpawnWreckClientRpc(tankObject.transform.position, tankObject.OwnerClientId);
    tankObject.Despawn();
    }
    }

    [ClientRpc]
    private void SpawnWreckClientRpc(Vector3 tankPos, ulong clientId) {
    if (clientId == NetworkManager.Singleton.LocalClientId) {
    selectUICam.SetActive(true);
    crosshair.SetActive(false);
    Cursor.lockState = CursorLockMode.None;
    battleButton.transform.position += new Vector3(1000, 0, 0);
    }
    Instantiate(tankBlow, tankPos, Quaternion.identity);
    }
     
  2. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    29
    I got this warning too. But it seems not have any effect on my project. I just ignore it.