Why are arguments of type System.Object not supported for Command or ClientRpc methods?

Hi
Can anyone tell me why arguments of type System.Object ie object are not supported for Command or ClientRpc methods? Seems like a huge limitation to me.

Here is my error
UNetWeaver error: parameter [Object] is of the type [System.Object] is not a valid type, please make sure to use a valid type.

I think there is a similar issue if using generics
https://answers.unity.com/questions/1104810/commandclientrpc-with-generic-parameter.html

Because the serializer the HLAPI is using doesn’t support it. Don’t see how it’s a huge limitation though? Just serialize it to a byte array and send that. Or change the hlapi serializer

1 Like