Multiplayer spawning not working properly (SOLVED)

Hello! so im trying to make a little fighting game for me and my friends but for some reason im having a little trouble with spawning each player

So it works totally fine when previewing the game in 2 windows but when I create a link for others to play it bugs out

Player 1’s screen:

Player 2’s screen:

After only showing player 1 teleporting around for a while on player 2’s screen, player 2 spawns in but you cant move around or do anything. Although you can still see player 1 moving around.

It seemed to work a few days ago before I added attacking etc. but ive tried removing the code for those and it didnt fix the problem

If anyone can help i’d really appreciate it :slight_smile:

Is this event something only the host does? It looks like it might be something all players run when their game starts, otherwise I don’t know how to account for the P0 when you clearly +1 to the spawn variable before creating anything. Unless that player, Player2, did not have access to the spawn variable to change it, and his lobby opened up a bit quicker than the host?

Anyway I ran into some interesting behaviors regarding a char creation event that was not exclusively controlled by the host. For one thing, players could pick the same random spot to spawn. For another, no one was where they should be on different screens - every players game reimagined the position of the other players at first. And then the general weirdness of movement that would obviously result.

In my project I couldn’t just change the events to make sure the host is doing them because the players can create and select chars before entering the lobby. So I had to give the placeholders a number variable and change each one to 1-8. Then in beg of scene events I just run


so only 1 player is making 1 char - their own - through their private variable.

Anyway some thoughts that might help you debug.

EDIT: Actually I just thought about it, I saw a good video awhile back that might help:

The way i solved this for myself is i just gave each spawnpoint a different number variable (because i was going to make the players spawn in a certain order anways) and made it so that if your current player number in the lobby matches the spawnpoint number it spawn the player there. Here’s the code in case anyone is interested :slight_smile:

1 Like