- Home /
Question by
dreamhst7 · Feb 21 at 11:32 AM ·
networkmultiplayer-networking
When I create a NetworkVariable FixedString512Bytes an error occurs
When I create a NetworkVariable<FixedString512Bytes>
in Unity.Netcode an error occurs on a client:
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
Unity.Netcode.NetworkManager.TransportIdToClientId (System.UInt64 transportId) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.4/Runtime/Core/NetworkManager.cs:1285)
...
This only happened if three clients connected. And it didn't happen when two clients connected. When I use FixedString64Bytes everything is ok.
How can I use a 512 byte string as NetworkVariable?
Comment
Answer by dreamhst7 · Feb 21 at 12:35 PM
It is because of limitation of UNet transport https://forum.unity.com/threads/netcode-for-gameobjects-keynotfoundexception-in-client-for-non-player-networkobjects.1217268/