Using TMPro.TMP_Dropdown in NReal

Hi

I’m slowly chipping away and constructing a UI with various controls on.

I’ve got toggles working and now I have added a TMPro.TMP_Dropdown component for controlling some stuff.

It appears OK and if clicked by the laserpointer it performs a dropdown and draws the items but then I cannot select any item.

It is wired, via Start() in a dedicated script for it, by delegate to a local method although this doesn’t matter yet as that will be fine…why isn’t it letting me select any items and closing?

The entire canvas has CanvasRaycastTarget script attached and that is working as all other components are clickable including the dropdown as it does dropdown if clicked.

Has anyone used one of these in NR stuff yet? I’m sure it’s prob me as I’m also learning more Unity as I go along.

Thanks

Leigh Tilley

1 Like

Yeah I had the same issue :joy: decided to switch to legacy drop-down

If you click on the TMP_Dropdown it will show you the list of options. If you pause the editor and click on the options, you’ll see that they are grouped inside a new canvas. THAT canvas doesn’t have CanvasRaycastTarget, so it can’t detect your Laser pointer.

1 Like

Haha nice one mate. Thanks for prompt reply; will switch to legacy one tomorrow when I get next chance to work on it. :slight_smile:

1 Like

Hey

I got to it today and i replaced the TNP DDs with Legacy DDs and I still get the same behaviour? :slight_smile:

I’m about to do a build/test run with NRSDK CanvasRayCastTarget script attached to one of the legacy DDs to see if that works.

Hey

Mmm, yes the legacy DDs can be clicked but like the TMP ones the dropdown cannot be clicked on nor do they close either. What else did you do in order to get the legacy one working please?

Thanks

Leigh

@Mr.FarePlay

Did you actually get the legacy DropDown to close up / select items with the laser?

I just, for piece of mind, created a normal 2D project and ran it and legacy dropdown works as expected with no modifications or coding. So then I went to my AR project and added a standard legacy dropdown in the middle of my app, just in case all of my modifications had done something weird (my 2 dropdowns are now very stylised), to check. Nothing.

I double-checked my other UI controls (custom 2rd party tree component, toggle, scrollbars) and they all work and are clickable.

What did you do if you got the legacy DD working please? :slight_smile: As I really need two dropdowns in my UI.

Thanks

Leigh

See my other post regarding dropdowns.

I’ve found some UI elements in ‘Modern UI Pack’ and I am going to use their ‘Horizontal Selector’.

I just found this so I think this is what you were referring to :slight_smile: