Search Unity

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

Question How do I find which object is associated with this Key in my Warning?

Discussion in 'Netcode for GameObjects' started by gamedevjake, Dec 4, 2023.

  1. gamedevjake

    gamedevjake

    Joined:
    Aug 16, 2022
    Posts:
    25
    I get this warning occasionally on my clients when my network game first starts up, but don't know how to lookup with GameObject/Network Object is associated with this key. It would save me a lot of time troubleshooting. Is there a way?

    [Netcode] Deferred messages were received for a trigger of type OnSpawn with key 1154, but that trigger was not received within within 1 second(s).

    Thanks!
     
  2. NoelStephens_Unity

    NoelStephens_Unity

    Unity Technologies

    Joined:
    Feb 12, 2022
    Posts:
    244
    This error needs to be improved. The issue is that your NetworkManager.NetworkConfig.SpawnTimeout is being hit and a message is being dropped. This happens if it takes longer than a second for the client to synchronize (we will be bumping this up to default to 10s in the next update) so any messages sent for yet-to-be-spawnd NetworkObjects are being dropped.

    Try increasing your NetworkManager.NetworkConfig.SpawnTimeout to something like 10 (seconds) and then see if you no longer get those messages? You should set this on the client side prior to invoking StartClient or when NetworkManager.OnClientStarted is invoked (if you are subscribing to that).