GUI3DManager.addControl modifies the position of the element added

Hi all,

I am using the GUI3DManager to create pressable buttons. I’ve noticed that using the addControl method modifies the position of the element added. Please see line 45 of the Playground:

GUI3DManager addControl modifies the position | Babylon.js Playground (babylonjs.com)

Thanks in advance,
Mark

I just discovered the ActionManager which provides the functionality I need without having to use the GUI3DManager.

Here’s an update to the Playground:

[GUI3DManager addControl modifies the position | Babylon.js Playground (babylonjs.com)](Babylon.js Playground W9SG3K#53)

Doc on actions: Actions | Babylon.js Documentation (babylonjs.com)

Yes that would also work (works for me). But it would work with the 3D Gui. I guess you noticed that your added pushbutton based on docPrev is not parented to your DocumentParent. Also attaching and detaching controls from an actual 3D GUI panel works well (from my own tests).

1 Like