#Strange issue using Netcode's Distributed Authority when a client leaves.

1 messages · Page 1 of 1 (latest)

zenith compass
#

I have bullet prefabs that destroy with the owner client when they leave. When the owner client leaves, for each of the bullets the client once shot (even if they're destroyed), remaining clients see the following message immediately:

[Netcode] [DestroyObjectMessage] Received destroy object message for NetworkObjectId (40003) on Client-1, but that NetworkObject does not exist!

10 seconds later, another warning follows for each of these bullets:

[Netcode] [Deferred OnSpawn] Messages were received for a trigger of type DestroyObjectMessage associated with id (40003), but the NetworkObject was not received within the timeout period 10 second(s).

I'm not doing anything unusual with these bullet prefabs. They are simply spawned by the client and despawned by the same client. I do not call Destroy() on the bullets, only despawn. The bullets no longer exist in the hierarchy of any client after they despawn. They are not pooled, but instantiated and destroyed by NGO.

-# For those who saw my strange DS LAN setup, this only happens when using DS correctly via Unity Services

Extremely confused about what could be solving this

leaden steeple
#

My guess would be that you don't have to call despawn if you're leaving Dont Destroy With Owner unchecked.

zenith compass
static escarp
#

Despawn() will destroy the object on the clients.

#

I think Despawn (false) will leave the object on the owner. Not sure how that works with DA though

leaden steeple
static escarp
#

You need to make sure that Despawn is only called by the bullets authority

zenith compass
zenith compass
static escarp
zenith compass
#

Manually

#

ooh, let me check something real quick

#
        {
            taskCanceller?.Cancel();

            State = NetcodeState.Disconnected;

            try
            {
                if (CurrentSession != null)
                    await CurrentSession.LeaveAsync();

                CurrentSession = null;
            }
            catch (SessionException)
            {

            }

            manager.Shutdown();
        }```
#

This is what I'm calling in order to disconnect