Mirror icon indicating copy to clipboard operation
Mirror copied to clipboard

How to cast connectionToServer correctly?

Open Holden97 opened this issue 3 years ago • 0 comments

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.

Holden97 avatar Aug 24 '22 13:08 Holden97