A bug I guess: If all the players get into the session from the start, 80% of the times each one has their own correct smooth camera, but if a player joins in the middle of the session the host always starts to get his camera ‘fighting’ with the camera of the player that just joined.
On top of this I made the username show the PlayerID and as you can see in the host window it shows both players as 1 but in the player 2 window it shows both players as 2.
Control wise each play character is correctly being controlled by the correct player.
Been trying to solve this for weeks now and can’t figure it out, any help is appreciated! Thanks in advance!
A few nitpicking things first - please don’t have an “At the beginning of the scene” as a condition of a “Repeat for each instance of Player” loop. Have a beginning of scene event, and make the repeat a subevent off that. Otherwise the repeat is processed every single game frame.
That last event can be done a lot differently. Use the sticker extension & behaviour, set the USERNAME.text once in a beginning of scene event block and stick it to the player.
There is no need for a trigger once if the event (or parent event) is has the “At the beginning of the scene” condition. By definition the beginning of scene only happens once.
And consider refactoring the first block of events (all those before the “USERNAME” Event Group) to:
That SmoothCamera behaviour is a right pain in the proverbial. It’ll synch across all players if they all join the lobby at the start.
But as soon as a player joins later, it screws up. And I’ve tried all manner of combinations to get it working, but it’s just refusing.
So I’ve come up with the following solution that works for late joiners. Although it doesn’t use the SmoothCamera behaviour, it implements a smooth moving camera with one event and 2 actions: