- Home /
Parameters for RPC calls/Commands
According to the docs the following parameters (Docs) are allowed for a remote command in unity networking, however I have two issues:
GameObject does not seem to be accepted as a parameter type, it does give an error on compiling.
How can I pass a List of Network Object references to the client?
From the same document:
GameObject with a NetworkIdentity component attached
Do all of your objects have NetworkIdentity components? You'll have to send them over the network one at a time.
I cannot even try to pass it. Already declaring a gameObject parameter throws an error when trying to compile in unity.
throws an error
To sum up:
You've written some code we can't see and you don't seem that you want to share it. This code has compiler errors which you see$$anonymous$$gly don't want to tell us. Now you want us to use some transhuman super powers to figure out what you've done wrong in your code that we don't see?
Answer by hexagonius · Oct 20, 2018 at 09:55 AM
Whatever error you have, make sure all these three requirements are met:
The class derives from NetworkBehaviour
The method is decorated with either the
[Command]
,[ClientRPC]
or[TargetRPC]
attributeThe function's name starts with
Cmd
in case of[Command]
orRpc
in case of either of the other two
If you still get an error paste the error here.