Hi,
I’m trying to figure out how to select a character, store that info while I’m entering the lobby and chat in my multiplayer game, and then spawn that particular player I selected when I press the start match button.
I read that the pthoton view ID is unique to gameobjects in a game so: Can I allocate a photon view ID for each of my characters in my game, so that when a gamer selects that player, the ID can be what determines which character spawns?
How do I store the ID ?
This is my spawn code for when I press start match, and it only works for one character in the resources folder called: “PlayerController” (There is no ID info called now):
[PunRPC]
private void RPC_CreatePlayer()
{
float randomValue = Random.Range(20f, 50f);
GameObject myPlayerGO = PhotonNetwork.Instantiate(Path.Combine(“Prefabs”, “PlayerController”), Vector3.up * randomValue, Quaternion.identity, 0);
}
I also need to be able to spawn characters at random spawn points and not somewhere inbetween Random.Range(20f, 50f);
I’d really appreciate the help.