Multiplayer - Tell each client to perform method

Hey guys, how are you?

My question might be simple, but I’m having a hard time figuring this one out.

I have a turn-based card game. In the game, each player has to click in their deck so the top card flips over, and the next one does the same.
How can I, after I click in my deck, tell all the other clients and the host to perform the animation of the card turning?

I don’t want to send/receive the animation info. Each player can flip the correct card in their builds. It’s not really that important.
Right now each card has a Network View component and when it turns, this component sends all that info to the other players, but it gets really laggy.

Thanks!

Having a lot of cards and syncing their transforms and animations could get laggy. How many cards are you using?

For a turn-based card game there isn’t a good reason to do this. Instead of having Unity automatically sync the state of each card each frame you only want to send information when a player action occurs. For this you want a single NetworkView, and instead of observing a component with that NetworkView you want to use it to send RPCs between clients and host.

Unity docs have a simple RPC example here:

http://docs.unity3d.com/Manual/net-RPCDetails.html

RPCMode.All sends to everybody including the sender (so you can have the sender use the same code as the receiver), or you can use RPCMode.Others to send to everybody except the sender.