My level opens, displaying a loading screen while a sub-level (the real one) is loading.
Clients connect to the server. When they connect, I want to spawn their character and make them possess it.
Problem is : how can I know the client finished loading the sub-level ? I can’t spawn the character before the client is really ready !
Hi ChezJau, you could use the following node to load a sublevel (set to not visible in the level window), and once it is loaded have execute a function on the sublevel blueprint, eg, in this screenshot called Init.
Thanks !
I couldn’t warn the gamemode because I was a mad bug victim lol. I load the sublevel from the main map. It warns the controller so it can display the loading widget. No Problem here. But when I created a “execute on server” event then tried to call it : “nope I refuse ! :p” . lol Every time the input had a “new boolea” name and made error. I could create it, compile then try to call it… it didn’t work. So I couldn’t et the variable on the server and read it from the gamemode.
Today (I’m in France), I tried to insist : creating the event, compiling, adding the bool input, compile, call it in the function, compile. Rince, repeat as fast as possible and MAGIC at some point it worked ! :eek:
Now I have a new problem lol. This seems to work fine
After the branch, I load all the necessary things, spawn the character and make the controller possess it.
But when I test and ask for 2 players as clients and hit Play, The first one never triggers this (never gets a character) and the second player gets a character that… falls into the ground…
Unreal, you hate me. I don’t know why, but you are mean ! :mad:
Ok you know what ? The widget loaded by the main menu works like a charm !
Now my main menu loads the loading widget (giving the map name on spawn) so I can load the game map directly.
It could also mean that you may have to add some Delay Node, depending on what you load. This can be a little difficult, but try add a Delay of 2 or 3 seconds before the character is loaded.
One thing to consider is that when clients are created their player controller is created for them that is defined in the game mode.
If you make a BP_PlayerController_Gameplay you could then spawn their character and possess on the beginplay of the player controller.
This might have the problem of the level not being entirely loaded on the level though since the player controller exists on the server and the client.
So you might need the begin play node to run an RPC against the server. I think beginplay for the player controller won’t happen on clients until everything is loaded. You know if it is “your” player controller by checking that playercontroller(0) = self on the player controller.