Hello there, I currently found an sligthly interesting bug that unfortunally interferes a lot with gameplay.
I have a widget that is spawned on Event BeginPlay() of player character that works at the same time as a HUD for the player.
I’ve set on that widget an Event Construct(), that modifies size and position of SizeBox on Canvas Panel that is supposed to be as X: 60% and Y: 25% of screen size, so it will always have proper size on screen no matter the screen size.
I’m genuinely stumped. The breakpoint should only pause the simulation the frame that event is called, pass the info to the BPdebugger and that’s it… I’m going to see if I can look into the source code for the breakpoints and see if there’s any other interaction, but that’s actually kind of whacky. Could you try to run that from another event instead of on construct real quick?
Here above is screen AFTER launching the function for resize, might not be really visible with screenshot but the widget did got resized properly and adjusted to viewport.
While called on BeginPlay(); from Player Character which spawns the widget and Construct(); from the target widget it does not work properly and completely dissapears for some reason without breakpoint.
While called manually or with a breakpoint on Construct(); or BeginPlay(); it works properly, so the function technically works properly.
Oh hmm, does the referenced stats size box change in position/size on construct/frame 0/1? I’m thinking this has to be dealing with the resize and reposition happening on construct but BeginPlay does it as well so this is odd. Let’s try one more test, reattach it to your construct, put a 0.0 delay node in front of it (basically a 1 frame delay), and see if it reacts.
That confirms my hunch that it’s one of those initialization issues I run into on the forums frequently enough, but really didn’t expect it for resizing UI elements. These are the types of actions that should work during construct. So the final question is, will the delay work for your game in this instance? As there’s likely no workaround better for construct issues. The one frame usually works for it however. Maybe if it needs to be there quickly and the pop in is ugly, you could dress it up with a timeline for visibility and make it fade in.
No problem! I learned something from this myself! Breakpoints actually do have an effect on the simulation by at minimum 1+ frame disruption. This will help in the future when working with similar cases.