I am making a hide and seek game, the server on game start sets the players roles in the game but nothing is running on clients.
If host is the seeker it works as intended but if the host isnt the seeker the nothing happens. The script is below:
Game Manager:
[Server]
public void SetSeeker()
{
int seekerIndex = Random.Range(0, gamePlayer.Count+1);
for (int i = 0; i < gamePlayer.Count; i++)
{
if (i == seekerIndex)
{
gamePlayer[i].RPCSetSeeker();
}
else
{
gamePlayer[i].RPCSetHider();
}
}
}
Player Object:
[TargetRpc]
public void RPCSetSeeker()
{
isSeeker = true;
}
[TargetRpc]
public void RPCSetHider()
{
isSeeker=false;
}