Download

UMG on Mobile

Hey everyone! My game is nearing completion (just a LOT of levels to create), but I’m running into an issue:
My UI works fine when I PIE for PC. However, when I PIE for Mobile, my UI stops working. When I start, the Main Menuworks fine…the Level Sect works fine. But when the level loads, my Level Start UI pops up (Shows best time and has a “begin” button), but I can’t click the begin button. I’m sure it’s something easy I’m missing…someone throw me a bone!

Hello,
if your umg works fine for PC but has issue in mobile, you would better ask to mobile users to have a chance to be helped, why i move your post. In hope it helps.

Edit : i moved thread in IOS. If you want to be moved in android section, send me a pm.

Without much details, all I can do is throw some random suggestions:

  • I noticed that the order in which BeginPlay events for the level blueprint and actors’ blueprints are called is different between PIE and everything else (mobile preview, standalone executable, actual device, etc). If your blueprints somehow depend on the level blueprint being called first/after some of your actor blueprints, you should change that.

  • The PlayerController has three functions called “Set Input Mode UI Only”, “Set Input Mode Game Only” and “Set Input Mode Game And UI”. Try calling “Set Input Mode Game And UI” after your level starts so you can interact with both the UI and the game.

@Fen - Thanks for moving the thread to the proper forum:)

@Pedro - The order thing makes sense. My main menu level is blank and the actual menu is created from the level blueprint. But when I load my actual game play level (e.g. Level_001), there is no level BP. The menu that starts the level is on my HUD BP. Should it not be?
Also, I do have the mode to UI and Game.

Where are you spawning the “Level Start UI” widget? I remember reading about a problem where widgets were tied to the level that spawned them, so if you spawned it before loading the game play level there might be problems. I am using a single base level and streaming my gameplay levels in/out, so I haven’t tested actually jumping between levels.

Pedro, I am spawning it from my HUD BP.
The order is: My base level has a Level BP that spawns the Main Menu widget. When “PLAY” is clicked, a Level Select Menu is created and added, Main Menu is removed. There’s some logic in this menu, but it just allows you to select which level you want to play (based on an unlocked flag). When the level is clicked, I call an event on the HUD Class that removed the Level Select Menu and adds the Start Level Menu, then the level is loaded.

This is on the Level Select Button

This is on the HUD BP

Do you think it would be more beneficial to stream the levels in and out instead of loading them? There is noting in the main start level…

by the way, you’ll see a function call to “Remove Level List” on the HUD BP…it’s not sued really. Just in case anyone wondered:)

I see you’re creating the level menu widget before loading the level, maybe that’s your problem. Try creating the level menu after the level has completed loading, maybe by calling OpenTheLevel on your HUD on your level’s BeginPlay.

About streaming, I opted for it because of the asynchronous loading and because it’s easier to persist actors across levels.

So, I moved my widget to the level blueprint and it kinda works. At least the first level works, but not after that (same level BP for each level). One day I’ll figure it out, hehe.

Hey, may I ask what your HUD class is doing here (BallHUD) and what the reasons were for not using a widget? I’m trying to figure out what the HUD class is good for… seen some examples but nothing that can be done easier by just using a widget in my humble and slightly in need of education opinion.

Thanks.

Good question. I’m not sure of the answer any more. This was how I had things set up pre-4.5 and haven’t changed anything. I know doing it this way was how I made some communications work (timer, saved game data, etc.). I hadn’t put much thought into eliminating the HUD altogether. I will look into that for sure. Thanks for the comment/suggestion!