Skip to content

Nested Network Objects not spawning properly on clients #1024

@michaelday008

Description

@michaelday008

Environment

Fishnet 4.6.22R
Unity 6000.3.10f1
Discord troubleshooting: https://discord.com/channels/424284635074134018/1034477094731784302/1482488485792448602

Issue

There are actually 2 bugs here demonstrated in this sample repoduction project:

  1. If a networkObject exists inside the hierarchy of a prefab, it will not activate on clients unless the entire nested hierarchy is client owned
  2. If the entire nested hierarchy is client owned, you will get a warning in the editor window
Spawned NetworkObject was expected to exist but does not for Id 7. This may occur if you sent a NetworkObject reference which does not exist, be it destroyed or if the client does not have visibility.

How to reproduce

  1. Build it and run the server copy in the built window
  2. Connect from editor as client
  3. Click all 3 spawn buttons on the server

Expected Behavior

All 3 buttons should result in a parent character object, with a child graphic object. The child graphic object should have a "Saddle" inside that is active on the client and on the server.

Actual Behavior.

  1. Server Owned Base / Server Owned Model: Saddle is not active
  2. Client Owned Base / Server Owned Model: Saddle is not active
  3. Client Owned Base / Client Owned Model: Saddle is active, but you get this warning in the logs on the client.
Spawned NetworkObject was expected to exist but does not for Id 7. This may occur if you sent a NetworkObject reference which does not exist, be it destroyed or if the client does not have visibility.
UnityEngine.Debug:LogWarning (object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogWarning (string) (at Assets/FishNet/Runtime/Managing/Logging/LevelLoggingConfiguration.cs:139)
FishNet.Managing.NetworkManager:InternalLogWarning (string) (at Assets/FishNet/Runtime/Managing/NetworkManager.Logging.cs:74)
FishNet.Managing.NetworkManagerExtensions:LogWarning (FishNet.Managing.NetworkManager,string) (at Assets/FishNet/Runtime/Managing/NetworkManager.Logging.cs:129)
FishNet.Serializing.Reader:ReadNetworkObject (int&,System.Collections.Generic.HashSet`1<int>,bool) (at Assets/FishNet/Runtime/Serializing/Reader.cs:1020)
FishNet.Serializing.Reader:ReadNetworkBehaviour (int&,byte&,System.Collections.Generic.HashSet`1<int>,bool) (at Assets/FishNet/Runtime/Serializing/Reader.cs:1088)
FishNet.Managing.Object.ManagedObjects:ReadNestedSpawnIds (FishNet.Serializing.PooledReader,FishNet.Managing.Object.SpawnType,System.Nullable`1<byte>&,System.Nullable`1<int>&,System.Nullable`1<byte>&,System.Collections.Generic.HashSet`1<int>) (at Assets/FishNet/Runtime/Managing/Object/ManagedObjects.Spawning.cs:264)
FishNet.Managing.Client.ClientObjects:ReadSpawn (FishNet.Serializing.PooledReader) (at Assets/FishNet/Runtime/Managing/Client/Object/ClientObjects.cs:449)
FishNet.Managing.Client.ClientManager:ParseReader (FishNet.Serializing.PooledReader,FishNet.Transporting.Channel,bool) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:497)
FishNet.Managing.Client.ClientManager:ParseReceived (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:425)
FishNet.Managing.Client.ClientManager:Transport_OnClientReceivedData (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Managing/Client/ClientManager.cs:373)
FishNet.Transporting.Tugboat.Tugboat:HandleClientReceivedDataArgs (FishNet.Transporting.ClientReceivedDataArgs) (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Tugboat.cs:290)
FishNet.Transporting.Tugboat.Client.ClientSocket:IterateIncoming () (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Core/ClientSocket.cs:254)
FishNet.Transporting.Tugboat.Tugboat:IterateIncoming (bool) (at Assets/FishNet/Runtime/Transporting/Transports/Tugboat/Tugboat.cs:237)
FishNet.Managing.Transporting.TransportManager:IterateIncoming (bool) (at Assets/FishNet/Runtime/Managing/Transporting/TransportManager.cs:750)
FishNet.Managing.Timing.TimeManager:TryIterateData (bool) (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:1112)
FishNet.Managing.Timing.TimeManager:IncreaseTick () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:733)
FishNet.Managing.Timing.TimeManager:<TickUpdate>g__MethodLogic|113_0 () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:392)
FishNet.Managing.Timing.TimeManager:TickUpdate () (at Assets/FishNet/Runtime/Managing/Timing/TimeManager.cs:380)
FishNet.Transporting.NetworkReaderLoop:Update () (at Assets/FishNet/Runtime/Transporting/NetworkReaderLoop.cs:29)

Reproduction Project

Included here

Bugs.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions