Multiplayer Question

Is there a way to have a positioning behavior not spawn all the players in the game to the same spot. Just one person?

1 Like

You would have to have some sort of global variable or input, but yes. Basically if the global variable is 0, then it spawns in slot one and ups the global variable by one. If the variable is 1, it spawns you in slot 2 and ups the variable again.

Slots? I still don’t know what you mean, maybe a picture?

1 Like

Positions not slots. Sorry for the confusion :confused:

Oh okay, thanks for the help!

No problem. Let me know if you’re still having difficulty afterwards.

Still, how can I make it for one player. I don’t understand. The players are the same sprite so idk how that works?

Global variables stay the same for every object. Another things you could do is count how many players are online with the players block.

I know, but for a different multiplayer game I made it so there was a tp and instead of tping one player it did all of them because it ran the code inside of the player. Making a global would still teleport all players because it’s inside of the players code. Right? Could take a picture of what you mean?

Oh ok. Have the teleport code in the player not the teleporter.

it was. but since there is a multiple users as a player sprite it will teleport them all since it will run the code for all players. :confused:

Not all player code is identical, try refreshing.

._. I’ve done that a million times,

I know what’s wrong I don’t know how to explain it. The message telling the player to teleport has to be in the player.

oh ok i see now i understand

1 Like

I had the raycast in the teleporter sprite and it sent a message instead of making it so the raycast, proximity or collision was inside of the player sprite.

Yes, so that’d send the message to every single player object which is why it was bugging out.

yep, makes so much sense now, am actually helping my friend make a multiplayer game since I just finished making my first one. “Pew Pew Madness”

1 Like

My very first multiplayer was this, I think.

This is my first multiplayer game. Pew Pew Madness