#ConnectedClients Error
1 messages · Page 1 of 1 (latest)
is there a reason you're adding the listener through code? And a reason why you're doing it on scene load?
I would just drag and drop UpdateStartButton in the inspector, and just not show the Start Button for clients in the first place
Avoids having to do most of this logic in the first place
im doing a few things, updating the start button Visual if enough players are connected, if not when you hover over it it will say invite players, I did have it set up in inspector but becuase the game doesnt start on this scene and this script doesnt get destroyed and is persistant, so it was a trade off to do it through code
if you go to a new scene and then come back the inspector gets wiped
and or probably causes error saying this has been destoryed but still trying to access, its been a month or two since i switched so i forget all the exact problems
Runtime changes get wiped. Not changes made while in Edit mode.
Also I would just make a script that's on the button itself.
so i just made it (!NetworkManager.Singleton.IsServer) return; instead
and it works no error now
so i guess what does that tell me?

it is
Yeah, weird.
My guess would be that it has to be something to do with performing this in OnSceneLoaded
Something not being initialized yet.
i think youre right, ill keep digging and let you know what i find, thanks!
i missed this happening, never had this happen before, maybe its causing issues
one sec
public struct PlayerData : IEquatable<PlayerData>, INetworkSerializable
{
public ulong clientId;
public Color color;
public int eyesIndex;
public int mouthIndex;
public FixedString64Bytes username;
public bool Equals(PlayerData other)
{
return clientId == other.clientId && username == other.username && color == other.color && eyesIndex == other.eyesIndex && mouthIndex == other.mouthIndex;
}
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref clientId);
serializer.SerializeValue(ref username);
serializer.SerializeValue(ref color);
serializer.SerializeValue(ref eyesIndex);
serializer.SerializeValue(ref mouthIndex);
}
}```
the issue was the memory leak causing everything to stop working, and the memory leak was due to the fact i wasnt using networkmanagers on destroy but just regular ondestroy.
so it was never disposing of my network list. Causing errors and hold ups and leaks
@pastel roost
Makes sense