Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Display different UMG UI according to the platform?

Hi all,

Does anyone know how to display different UMG UI according to the platform(including the device simulation, e.g, setting Target Platform to Mobile and PIE the game on Windows.)? Just like Virtual Joystick.

Thank a lot.

Product Version: UE 4.13
more ▼

asked Sep 23 '16 at 01:48 AM in Blueprint Scripting

avatar image

1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

There is no passive method for that, you need to make stuff visible or load specific widget depending on platfrom name from here:


You can't detect PIE in blueprints, you would need to make your own nodes (which is not that hard) in C++ using those functions in world instance:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UWorld/IsPlayInEditor/index.html https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UWorld/IsPlayInMobilePreview/index.html

more ▼

answered Sep 23 '16 at 02:34 AM

avatar image

36.7k 932 169 1111

avatar image crtapps Sep 23 '16 at 04:07 AM

Thanks for you reply, but I have another problem.

I wrote a BlueprintCallable function named 'IsPlayInMobilePreview' in my PlayerController and call it in my HUD blueprint with the Event BeginPlay.

My IsPlayInMobilePreview function's implementation is just call another function in UWorld, like this:

return GetWorld()->IsPlayInMobilePreview();

But it always return false. I debugged it and found the real reason is:

FParse::Param(FCommandLine::Get(), TEXT("simmobile"));

always get FALSE result.

I have tried launch the game with -simmobile commandline parameter and PIE with Mobile Preview, but get the same result, it's always FALSE.

How do I solve this problem?

avatar image Shadowriver Sep 23 '16 at 04:10 PM

You not using Vulkan in that preview right?

avatar image crtapps Sep 26 '16 at 10:37 AM

Yes, no Vulkan.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question