Merging horizontal and vertical panels doesn't work

hello guys,

I want to create a button and on the right, create a vertical list of buttons, for that I create a vertical panel the first element is a button and the second is a horizontal panel.
the problem is that when I write panal1.addControl(panel2), and then create my horizontal buttons, when I run it doesn’t display my panel2.

here is PG



Check the console :slight_smile:

To avoid infinite recursion you cannot have a control with widht set in percentage inside a horizontal panel.
So you must define the width in pixel

@Deltakosh the problem is when I ant to create panel.addControl(panel2) I don’t know why he didn’t let me to add a vertical panel inside a horizontal one (I want to create a button and then when I click I display a vertical list beside it and then when I click I display another vertical liste beside in horizontal way).
so I decide to add vertical panel inside horizontal one and then add buttons to it but it doesn’t work
here Babylon.js Playground when I comment the line 48 the error disapear :frowning:

Hey here is the fix:

Two hints:

  • Name all your controls so the errors or the inspector is easier to read
  • Make sure to set width to pixel values when inside a horizontal stack panel (line #49)
1 Like

okay, thank u dud