Mirror
Mirror copied to clipboard
How to cast connectionToServer correctly?
when I use connectionToServer.clientOwnedObjects in a client like this var clientObjects = isServer ? connectionToClient.clientOwnedObjects :((NetworkConnectionToClient) connectionToServer).clientOwnedObjects;
it debugs a log that InvalidCastException: Specified cast is not valid. From the comments I knew it was obsolete.However,I used ((NetworkConnectionToClient) connectionToServer).clientOwnedObjects to cast it forcibly,I still received this Error. So how can I cast it correctly? My English is not good.I hope you can understand my expression.