The firing command doesn't work on the client. It shows on the server but the client does nothing even though I'm calling this from the client. It's supposed to shoot which it does on the server but on the client side the player does nothing.

  void Update()
{
    // if (isLocalPlayer)
    //  {
    if (!isLocalPlayer)
    {
       // Debug.LogWarning("NOT LOCAL");
        return;
    }


    if (Input.GetMouseButtonDown(0))
        {
            Cmdtrigger1();}





}

[Command]
void Cmdtrigger1()
{
    this.firingData.isFiring = true;
    EventManager.TriggerEvent("trigger1" + playerId, null);
    EventManager.TriggerEvent("getFiring" + playerId, firingData);
    Debug.LogError("left mouse button has been pressed");
}
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.