I don’t know what is breaking your UI, But I suppose you need to move code from block: statement within class, that works as a constructor, to a new place.
For example, I was using countdown_timer class and I moved code after block statement (that is commented) to a new method SetUpCanvas.
countdown_timer<public> := class:
# block:
# set Canvas = canvas:
# Slots := array:
# canvas_slot:
# Anchors := anchors:
# Minimum := vector2{X := 0.5, Y := 0.65}
# Maximum := vector2{X := 0.5, Y := 0.65}
# Alignment := vector2{X := 0.5, Y := 0.0}
# Offsets := margin{Top := 0.0, Left := 0.0, Bottom := 0.0, Right := 0.0}
# SizeToContent := true
# Widget := RemainingTimeWidget
MaybePlayerUI : ?player_ui = false
var RemainingTime : float = 0.0
var Canvas<public> : canvas = canvas{}
RemainingTimeWidget : text_block = text_block{DefaultTextColor := NamedColors.White}
TimerTickPeriod : float = 1.0
SetUpCanvas():void=
set Canvas = canvas:
Slots := array:
canvas_slot:
Anchors := anchors:
Minimum := vector2{X := 0.5, Y := 0.65}
Maximum := vector2{X := 0.5, Y := 0.65}
Alignment := vector2{X := 0.5, Y := 0.0}
Offsets := margin{Top := 0.0, Left := 0.0, Bottom := 0.0, Right := 0.0}
SizeToContent := true
Widget := RemainingTimeWidget
After this, place where I was using this timer I need to rework in order to call SetUpCanvas method after I constructed the class.
This is just a temporary solution for my example. I have to rework this whole countdown_timer class.
You can also try putting your block code into <constructor> method.
@davidpkami Thank you for your report! Can you please re-post using the “New Issue” option on the Issues and Bug Reporting forums? Posts with this feature are connected directly into our development team so we can quickly get to them!
For more information, such as how to get the reference ID, please check out the article here: Using the Creative and UEFN Bug Reporting Form