Hello There,
I am having an issue with my custom event (Update Lobby) not working I put in a print string in it to see if it was called and it wouldn’t call for some reason. I can’t figure out the reason why and I will post screenshots.
Hello There,
I am having an issue with my custom event (Update Lobby) not working I put in a print string in it to see if it was called and it wouldn’t call for some reason. I can’t figure out the reason why and I will post screenshots.
what calls ServerSelectLevels?
Its being called under Event Construct listed in LobbyMenu ill take a few screen shots of it and there’s a lot of code in it.
i bit hard to follow but since its on construct the server is likely calling it before the other players exist.
a better way is to use the GameState which is replicated and use a RepNotify. But to test it use a breakpoint (F9) on the IsServer branch and see what happens
What if I put a delay in it? Would that fix it maybe?
possibly, its good for testing but ultimately not a solution. If you know how many players are connnecting you could wait for all players before constructing
Okay, and yea I got it to set the custom player count is user defined at the moment, how would I go about making it wait until all players connected? I’m still learning and been going off youtube videos for tutorials and this guy had a lobby menu system I was following via @ Make a Multiplayer Game in Unreal Engine 5 - Seamless Travel, Level Selection and Loadscreen -Part 5 I followed all the other parts of his video series until this 5th one and it’s also not loading up the Level Selection widget either it should be showing a preview image of the map and map name where it says text block.
You have the OnPostLogin event to know when a player has joined which i assume you’re already using? You could then fetch the data from the server.
the thing is RPCs can be dropped or missed, its better to use RepNotify which would required the GameState, the GameState also has a PlayerList. It just depends how much you want to refactor the code.
Did you try the delay? its good to at least isolate the problem first
I tried the delay and it didn’t work either and yes I am using OnPostLogin as well to , I am trouble shooting stuff now trying to figure out what’s not working and etc.
Should I create a custom event and call it in onpostlogin for all the code I put in EventConstruct?
Couple of things to consider,
neither the GM or Widgets replicate at all.
your only creating the widgets on server so even if you replicated the ‘map’ the client doesnt even have them?
Use GetOwningPlayer not GetPlayerController(0)
youre setting some Text Variables but are you setting the TextWidget
your UpdateLobby has different Inputs, are you calling the right function?
Alright I’ll take a look and give it my all to try to fix it, may re watch the video again see if I messed something up or not it shows it works in the video but doesn’t want to work for me. I noticed I have two update lobby custom events one in player controller and the other in gamemode i have no idea which one I should be calliing lol.