I have another approach for You - one that involves no coding and only requires Hype's built-in capabilities, is simple to set up, and quickly adapts to to a variable number of buttons. It is also easy to reuse for other scenes or projects.
The basic idea is You use Hype's "Physics" engine to float the menu buttons. The menu buttons are hemmed in by (3) static elements - constraints (left, top, right) - that hold them in position... think of helium balloons in a box just wide enough for one balloon and tall enough to hold all of them in a column. When the viewer clicks on one of the buttons its display is set to "none" and then moved laterally out of the button grouping. This lateral movement allows any buttons underneath it to float up to the next empty space.
The screen shot below shows the (3) constraints around the buttons, here shown in lime green for ease of viewing - but would be set to a Fill style of "None" (invisible) in actual use.
"Constraints around the buttons"
Next select all the Menu buttons and, using the Physics Inspector, choose "Dynamic-Full Physics Body" as per the screen shot below. I set all but one field in this panel to "0". I left the "Scene Physics Gravity" at "1.0". This is my first time using the Physics Engine so these numbers are suggestions only - You might find better settings for your needs - experiment!
The lime green constraints (please see the screen shot above) are set to "Static - Interacts without movement". They will not budge and hold our floating Menu buttons in place.
One more procedure: Create a unique short timeline (I used 1/10th sec in my attached Hype example) for each button. This timeline will control the "display" & "left origin" You can copy and paste the settings from one timeline to another because the settings are identical for all buttons. Hiding & moving elements using code by itself will not trigger the Physics - at least in my experiments - a timeline needs to run.
Total time to create this "floating" menu interface - less than three minutes (excluding button design or button code You wish to execute); and once created it is easy to copy & paste the interface. Very adaptable.
The Hype Project file:
FloatMenu.hype.zip (23.3 KB)
The video snippet below shows a demo of the attached Hype file: