Version: 4.7.6
When you’re using the GetViewportSize in editor, it should return the size of that editor panel, but it seems to return the values we set in the editor prefs for the standalone windows.
Version: 4.7.6
When you’re using the GetViewportSize in editor, it should return the size of that editor panel, but it seems to return the values we set in the editor prefs for the standalone windows.
Hi nafonso -
Can you give me some details of how you are setting up this test? I’ve tried a few ways in 4.7.6 and it is always returning the correct viewport size. Here are my tests:
In Player Controller Event Graph:
Add a Key Press Event for “H”
Add a GetViewportSize node (non-HUD)
Pull off GetViewportSize node and Break Vector2D
Add (2) Print String nodes
Connect the X to one of the Print String nodes and the Y to the other.
Connect “H” key press to X Print String
Connect X Print String to Y Print String
Compile and Save
Add a Key Press Event for “J”
Add a GetViewportSize node (HUD)
Add (2) Print String nodes
Connect the X to one of the Print String nodes and the Y to the other.
Connect “J” key press to X Print String
Connect X Print String to Y Print String
Compile and Save
In Level Blueprint:
Let me know what you are doing different -
Eric Ketchum
Well this is odd… Since I reopened UE it is working.
In the HUD BP, I was calling GetViewportSize, and it was always returning 640x320. Now it returns 1172x730 (basically the view size).
However, something that was working before, isn’t working now. Previously, when I launched the game with 3 players, I’d have half top of the screen with player 1, and then bottom divided in 2 with player 2 and player 3.
Now, it shows a black screen, and only the UI is visible. The game is running, because if I move the character around it does die, so something odd is happening with 3 players.
If I choose 1, 2, or 4 players, it works normally.
Can’t reproduce it again, feel free to close it, sorry for the trouble. If it comes up again, I’ll reopen it. In the mean time I’ll try to reproduce the other issue on a clean project.