Major help with making this blueprint!

So I haven’t created the BP yet because I don’t know if their are nodes for it or even if it’s possible to make this BP for UE4 right now. What i’m trying to do is a BP or node that detects the screen size the player is playing in and IF the screen size matches the imputed screen resolution I put (my game is for mobile so in my case I put IF the screen resolution == 1280x720) THEN execute whatever. However IF it’s not that imputed resolution then execute something else. I understand that i obviously need an IF command but how do I make a BP that’ll detect the screen resolution and see if it’s equal to the screen resolution that I imputed manually for ex 1280x720. Is this possible for BPs in UE4 or no. If so how do I go about doing so. Much help appreciated!

You can make a HUD BP and in it there is a node EventReceiveDrawHUD which gets the screen size X and Y from there you could perform your check and call the result from another BP to perform whatever action or perform that action in the HUD BP:

Instead of HUD BP would this work with “get viewport size”? Are is my way wrong and wont work and your way the only way to make this work. Are is their something wrong with my BP.

That should work too, the HUD BP is just a place I know that that node is easily grabbed. That should return the same values as the Event Receive Draw HUD but it will only do the check the one time, whereas the HUD BP will do the check every frame so on a mobile device at beginplay the resolution may be different than a few moments later if the player rotates their screen. You can test this using just the PIE, run a print string from the HUD BP size x and y and then go from the editor viewport to full screen mode and you will see the return values change.

Well you see my main menu i created in the widget editor HUD doesn’t fit on screens with 720p resolution or lower. It fits for 1080p and higher though. So when I play the app on a 720p phone the main menu is messed up and zoomed in. I also set the DPI settings to make it work for low res mobile screens and I even copied the Unreal match game example DPI settings. So instead I created a duplicate main menu but changed the menu to make it fit small screens. Then I created 2 new empty levels. One called “ResolutionCheck” and another called “main menu 720p” (which is the level that opens up the main menu HUD for 720p). In the ResolutionChecker level I went to the level Bp and put that BP i posted recently and if it returns true than open the Main menu 720p level. If returns false then open up the original main menu. So pretty much I only need the screen size check to execute once and that’s it. Plus I’m not the best in BP and have know knowledge on HUD BP so I don’t know entirely what to do. I’ll report back if my BP is working.

That setup should work I didn’t know what logic would be happening after the check so I just thought I would point out the differences just in case.

Hey I tested it out on my note 2 witch is exactly 720×1280 however unfortunately it’s not working. I even switched the values and made 720 for return value Y and 1280 return value X just in case but still doesn’t work. I don’t understand I honestly thought it would work. In theory at least. Can you help me fix this problem if you have an idea. That would be greatly appreciated. This problem is seriously holding me back. Thanks you!

Setup a print string to help debug what values are getting fed into the check…

OK I put this print strings. I’ll upload it to the google play store ALPHA testing and tell you what I get. Also I forgot to tell you I also tested this on my S6 edge+ phone with is above 1080p and it opened up the default main menu level.

The print string should print the values being returned by the Get Viewport Size we already know if the check triggers true of false by the behavior…we need to find out what the values are to see if the check needs to be adjusted. Maybe == isn’t the way to go but more of a nearly equal since there may be slight value differences in the sizes.

82510-nearlyequalfloat.png

I’ve never used Nearly Equal before. Do I connect A to Return X and B to return Y and leave error Tolerance as is? Sorry for the noob question.

A would go to size X or Y…B is the size you are checking them against so the logic is this if A is nearly equal to B with a tolerance of 10 then true…so if the size X is 1278.99 it would go into the nearly equal and be seen as almost equal to 1280 and return true…make sense? The == is just too strict I think

No bother at all, I am here to help, the print strings should do this to get the float values:

Everything else can still be connected I was just showing the float to string that you need don’t mind the missing stuff

Here is the completed version:

Sorry if i’m bothering you. This is what I came up with for nearly equal, but I don’t know if it’s right. Is this how it would be done?

This would actually be more useful since it labels the X and Y values:

Sorry unfortunately I tried it out and it doesn’t work : ( . I tried on bother my note 2 and S6 edge+ and it doesn’t work for some reason. Also the strings don’t print on mobile screens i think it’s because the sting doesnt have time to print because it opens the next level when the if statment is executed. And printing the sting is on the ResolutionChecker level. Im not sure though. Anyways regardless it’s not working. If you can still help that would be awsome. If you don’t know whats wrong that’s fine.

Ok sorry how do you do that? Is there a node specifically for it?

Oh alright you want me to just get the values instead. The if statment execution isn’t important right now. Alright i get it.

Ah yes of course…to help with debugging you should disconnect the load levels