[MLAPI] How do I activate code on particular player instances?

Sorry if this is already in the documentation, but I couldn’t seem to find it.

I’m trying to do a few things, but can’t figure out how:

  1. Have UI buttons make the player do things
  2. How to have the server access the player gameobjects and check values on each
  3. How to have the server activate commands on particular clients
  4. Other related things I can’t put into words right now

I know it can be done, I’m just a dummyhead and can’t figure it out. Help?

  1. I’m not sure what there is to say for MLAPI specifically. Your button will call a function when it’s pressed. In that function you can call a ServerRpc to run logic on the server.
  2. The server has a copy of all network objects which exist. You can just access the NetworkVariables on the server object.
  3. Use ClientRpcs

If you need more information on any of those please let me know. I can also recommend the videos from Dapper Dino about MLAPI, they are very beginner friendly: https://docs-multiplayer.unity3d.com/docs/learn/dapper-video

I’m mostly referring to the individual players, to control them. I want pressing a button to only activate something for that player, not all players.

I figured out how to say what I want to do more clearly.

Lets say a player is attacking another player. I want to be do something like otherPlayer.TakeDamage() and have it work over the network. How do I do that?