Hi, I want to make a simple 2D online game.
There can only be 3 players at the same time and each of them has a fixed position.
Player 1 (th actual player) on the left,
Player 2 (enemy player 1) in the middle,
Player 3 (enemy player 2) on the right.
I know that I could set all players random on one of those 3 positions, but I want that the actual player is ALWAYS on the left side.
How can I do this?
Thanks for answers!
If you want to have the players/enemies at fixed positions, just do that:
Define the postions either in the inspector or in the code. Alternatively, you could just randomize the enemy positions, but leave the player position always the same. You can set the values of the positions vector either in the Inspector, or in the script like I did:
public Vector3 positions;
positions = new Vector3;
positions = new Vector3(-5,1,0); //left
positions = new Vector3(0,1,0); //middle
positions = new Vector3(5,1,0); //right
player.transform.position = positions;
enemy1.transform.position = positions;
enemy2.transform.position = positions;