Im trying to learn network so im working on a project to get better at it. All I need is this script converted to network so I can understand it.
heres the script
public GameObject head;
public Animation walk;
public int speed = 1;
public GameObject MouthOpen;
public GameObject MouthClosed;
public GameObject eyeLids;
void Start()
{
MouthClosed.active = false;
eyeLids.active = false;
}
void Update()
{
if(Input.GetKeyDown(KeyCode.T))
{
MouthOpen.active = true;
MouthClosed.active = false;
}
if(Input.GetKeyUp(KeyCode.T))
{
MouthOpen.active = false;
MouthClosed.active = true;
}
if(Input.GetKeyDown(KeyCode.B))
{
eyeLids.active = true;
}
if(Input.GetKeyUp(KeyCode.B))
{
eyeLids.active = false;
}
if(Input.GetKey(KeyCode.W))
{
animation.Play("Walk", PlayMode.StopAll);
animation["Walk"].speed = 14 + speed;
}
if(!Input.anyKey)
{
animation.Play("idle", PlayMode.StopAll);
animation["idle"].speed = 2;
head.transform.localPosition = new Vector3(0, 2.4f, 0);
}
if(Input.GetKey(KeyCode.LeftShift))
{
animation.Play("crouch");
head.transform.localPosition = new Vector3(0, 2.1f, 0.6f);
}
}