Who should do the random things?
Options
SoBiT
✭
Hello Community
I need to do the following: When a room is full, the host can start the game. Easy so far. Now there comes the problem. If there are 8 Players, 1 of them is an "enemy" and the other 7 have to fight against him. This enemy is randomly selected. Who should run this random script? The server will not be able, because I use the cloud. So I think it's best if the host runs this function. But how do I tell each player what they have to instantiate? Because only 1 player gets the command to instantiate an enemy prefab. The others have to instantiate a common player prefab.
I hope you know what I mean. And another question. If I have 12 spawn-points and each player has to spawn at a different one. Who has to run this script?
I think I have big problems with imaging how the communication between the clients works.
Thanks in advance for helping me.
Cheers
SoBiT
I need to do the following: When a room is full, the host can start the game. Easy so far. Now there comes the problem. If there are 8 Players, 1 of them is an "enemy" and the other 7 have to fight against him. This enemy is randomly selected. Who should run this random script? The server will not be able, because I use the cloud. So I think it's best if the host runs this function. But how do I tell each player what they have to instantiate? Because only 1 player gets the command to instantiate an enemy prefab. The others have to instantiate a common player prefab.
I hope you know what I mean. And another question. If I have 12 spawn-points and each player has to spawn at a different one. Who has to run this script?
I think I have big problems with imaging how the communication between the clients works.
Thanks in advance for helping me.
Cheers
SoBiT
0
Comments
-
Hi
Let the Host decide who the enemy is.
Then the Host sends an RPC to tell every player who he is , enemy or not.
I think you can let the players get a random spawn point themselves . They just might spawn at the same point.1