Ah, I see. When using Simulate or PlayInEditor you will always get the perspective viewport size. You will need to play in New Window mode, Standalone mode, or Mobile Preview to get the correct window size. If using New Window mode, make sure to enable ‘Always center window to screen’.
As a workaround, you could grab the edges of the viewport and drag it to the approximate size you need, although this isn’t perfectly accurate it may get you by enough to simulate during development.
Another idea would be to feed the values 640x1136 into the blueprint manually while developing, then change the functionality back when you go to publish.
I played the game using New windows mode (640*1136 Ipad5), not Simulate or PlayInEditor. So, I dont understand why return Y value is wrong… Actually 1030 on the screen shot :
Do you have ‘Always center window to screen’ enabled for Play in New Window mode? If you don’t, this will cause it to return a different value than the set size.
I’m having this same issue where get viewport size doesn’t return the correct viewport size when I Play in New Window. Always center has no effect on this behavior. Can this get entered as a bug?
Further testing reveals it’s returning the entire window size not the rendered viewport size.