How do I call a function on other clients computers with UNet?

Say I’m a client and I do an attack, so I want to send all other clients that they need my avatar to do an attack animation on their computers.

I know I can use a Command, say CmdAttackOnOtherComputers and then this will tell the server that my avatar should attack, and then I can have the server call an RPC telling all my avatars to do the attack animation on all computers.

But this will also tell MY computer to attack as well. How do I only tell all the OTHER computers to do the attack, because my computer already knows to do it?

You should be able to filter out the host machine from playing the animation by using ‘base.isLocalPlayer’ but this would only work if the ClientRpc is being called on the Player Prefab. The same could be done in the reverse, where it only fires the animation if ‘base.isLocalPlayer’ is false.

You may want to remove the animation call and only call it during the ClientRpc instead though, as this way you only have one section that will play the animation, so if you make a change down the road you don’t have to do this in 2 areas.