what i want to do:
when client A presses a button, i want a child of the player character to become active for a short time.
what works so far:
when i press the button, i see the object become active on the client that presses the button and on the server.
i do it this way:
//in Update
if (Input.GetKeyDown(KeyCode.Space))
{
StartCoroutine(Slash());
}
.
IEnumerator Slash()
{
slashObject.SetActive(true);
CmdSlashOn();
yield return new WaitForSeconds(0.3F);
slashObject.SetActive(false);
CmdSlashOff();
}
.
[Command]
void CmdSlashOn()
{
slashObject.SetActive(true);
}
[Command]
void CmdSlashOff()
{
slashObject.SetActive(false);
}
what i want and cannot figure out how to do:
if there are two clients connected to the server, i just see the object becoming active on the client that presses the button and on the server. the other client is NOT seing the object become active. how can i send the information about the isActive change to all other clients?
thanks for your help!