Player Button Recording

If you are writing your own script and would like to send the player input over the network in a very similar fashion like I am doing in all the MP_ components. You will need to do the following:

First define a button you want to sync over the network and an appropriate NetworkCall component:

protected BasicNetworkCalls nc = null;
public GenericInput myButton = new GenericInput("W", "", "");

(This is just invector code, nothing different here.) You will notice I said an appropriate NetworkCall. Here I'm using a BasicNetworkCall component because this component is what is currently attached to my Basic Locomotion character. If you were using a Melee character use the MeleeNetworkCalls or if a shooter character ShooterNetworkCalls component.

Now lets make it so you can transmit it. In your Start method add the following peice of code:

protected void Start()
{
    nc = GetComponent<BasicNetworkCalls>();
    myButton.SetNetworkCalls(nc, "MySpecialButton");
}

In the SetNetworkCalls component you need to specify the NetworkCalls component you will be using and a globally unique button name. If it isn't globally unique you will get overwrites happening across the network.

That' it, your done! Now just use the button normally throughout your code (EX: myButton.GetButtonDown()) and it will transmit these actions across the network to the networked versions of your character.