DESPERATE problem Command not execute from client

Suddenly, it worked this morning, I am not able to send commands from Remote-Client Player and I have no idea why? It work with Host-Client Player (Red). I desperately need to solve this ASAP.

Here is the basic code:

public void On_1f_TouchStart (Gesture gesture) {
        //print ("On_1f_TouchStart");

        if (!isLocalPlayer)
            return;

        if (!hasAuthority)
            return;
        print("Print Cmd_FFF ('DD')");
        Cmd_FFF ("DD");


[Command]
    void Cmd_FFF (string fff) {
        print ("Cmd: " + fff);
    }

Red player is host-client and Blue player is remote-client.

Result from Host-side-client in editor:

Result when running remote-client on Editor, Cmd is never processed:

Command sent from Player, see settings:
uploading pictures

Anyone that have any ideas why this may happen? Could it be so that the network is not properly configured or not active? I get no messages in the console and it worked earlier today.

Could it be a bug?

Any help or ideas will be HIGHLY appreciated!

That’s the correct behavior. The command will only run on the server (host.) That’s what a command is for. When you see “Print Cmd_FFF (‘DD’)” on blue, you should see Print Cmd_FFF (‘DD’) on red.

@angusmf Thanks for responding. I think i was not clear in my description. The results is when i click on respective side. I am configuring so the host is on the player i generate and use the remote-client in the editor, which generates the print. I have also tried with tracing and trigger/trap the code but it never hits the Cmd-code. Updated the question above.

Found this in the log, maybe it has something to do with this:

You should never see the [Command] print unless the Host is running in the editor. The Cmd will always be executed on the server.

Thus when the Host is in the standalone, and the Remote-Client is in the editor. The Cmd Print is printed on the Standalone, the version that doesn’t have the debug log for you to see it.

That doesn’t’ mean its not being executed though.

tx. However, i have tried all kind of things without it executing the Cmd and now it working suddenly again??? …i did not change in the code except putting in prints trying to step the code. No additional code lines. I am confused, but happy it working again. I have checked all the settings including the service. I have restored the same last version from Collaborate approx. 10 times. Maybe it has something to do with that, who knows?? Again, tx for your help.

Hi, I’m having a similar issue here.
I built a client on an iOS device and run Unity Editor as a server.
The client calls the [Command] methods, but it’s executed on the client not on the server. The debug message is shown on the client(iOS) not server(Unity Console)…

1 Like

Have you figured out why the command was executed on the client only? I’m just struggling with the same behaviour…

I had a similar issuer, when the [command] was executed from the context of a MonoBehaviour - i.e. from inside a MonoBehaviours Update() function. What fixed it, was to ensure the [command] gets executed from inside its NetworkBehaviour’s Update() function.