!islocalplayer

I’m doing a “knockback” effect, it works fine if the player knocks himself back

    [ClientRpc]
    void RpcKnock()
    {
        print(pushDirection);

        if (isLocalPlayer)
        {
            Vector3 kbStartPoint = transform.position;
            Vector3 kbEndPoint = kbStartPoint + pushDirection * dashDistance;
            for (float t = 0f; t < 1f; t += Time.deltaTime * dashSpeed)
            {
                transform.position = Vector3.Lerp(kbStartPoint, kbEndPoint, t);
            }

        }
    }

what I want is for the player to knock the other player… I tried :

    [ClientRpc]
    void RpcKnock()
    {
        print(pushDirection);

        if (!isLocalPlayer)
        {
            Vector3 kbStartPoint = transform.position;
            Vector3 kbEndPoint = kbStartPoint + pushDirection * dashDistance;
            for (float t = 0f; t < 1f; t += Time.deltaTime * dashSpeed)
            {
                transform.position = Vector3.Lerp(kbStartPoint, kbEndPoint, t);
            }
        }
    }

checking if NOT the local player… the code doesn’t get called…
Is this the wrong way to check for other players?

Thanks !! That’s perfect. You’re a saint . Do I need to make the answer as correct ? That’s maybe a different site . Thanks again.