- Home /
Mutliplayer SetActive(true)
Hi, i have my multiplayer game, when i spawn my player i use the folowing line:
player.SetActive(true);
via RPC call...
until now everything goes fine. but when i have i.e 2 players, and someone spawn, the screen of the other people flashes the player for a mili second, no errors on that, but it is ugly and annoying. someone can help ?
code:
[RPC]
void Client_SpawnPlayer(NetworkPlayer player, Vector3 position, Quaternion rotation)
{
NetworkManager.GetMPPlayer(player).playerIsAlive = true;
NetworkManager.GetMPPlayer(player).playerHealth = 100;
if (player == myPlayer.playerNetwork)
{
myPlayer.playerManager.player.transform.position = position;
myPlayer.playerManager.player.transform.rotation = rotation;
myPlayer.playerManager.networkView.RPC("Client_PlayerAlive", RPCMode.All);
}
else
{
}
}
the line: myPlayer.playerManager.networkView.RPC("Client_PlayerAlive", RPCMode.All);
just SetActive my player GameObject.
Your answer
![](https://koobas.hobune.stream/wayback/20220613160438im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
RPC function to update clients varialbe 0 Answers
Network - Killing Player, Then Respawn - Issue with RPC 1 Answer
Network initializing player 1 Answer
Network n00b - how to refer to synced gameObjects in a multiplayer scene? 0 Answers
Joining a Running Server (Game) and Waiting for Game State Data. How? 1 Answer