Hello everyone. I’m currently working on a multiplayer game and I’m having some trouble with the networking part. I have a player game object that gets spawned with the appropriate permissions and basically works. Next, I added code to attach scripts to the player based on which ability he picked up as the game is running. These scripts derive from
NetworkBehaviour. This way, I should be able to use
[Server] attributes in them for the abilities I want to spawn something for (using
NetworkServer). Note that when the player picks up an ability, the script gets attached to the player on all the clients and server.
However, when using the
[Command] attribute on a function, I notice that it gets executed on the client and does not get called on the server. I get warnings for the code marked with
[Server]. My suspicion is that since I’m attaching a script to an object that already exists when the game started, the command call fails. Does anyone know if that might be the case?