I need help running functions on all clients and the host.
I tried the below code but it only worked on the host not on clients.
In this code I have made a jump up skill. When players take it, they can use it by pressing R button. It works fine in host but on clients doesn't work.
[Command]
void Cmd_ProvideJumpToserver()
{
Rpc_JumpUp();
}
[ClientRpc]
void Rpc_JumpUp()
{
if (JumpUp == 1)
{
Debug.Log("Jump Up Used");
gameObject.GetComponent<Rigidbody2D>().AddForce(Vector2.up * 15f, ForceMode2D.Impulse);
JumpUp = 0;
}
}
JumpUp
to one.JumpUp
to 1? also you get theJump Up Used
method on the client or only the host?