playMaker

Author Topic: Set UI Drop Down value by string instead of index?  (Read 252 times)

Silicon Power

  • Full Member
  • ***
  • Posts: 186
Set UI Drop Down value by string instead of index?
« on: April 01, 2023, 05:14:36 AM »
Hi Play Maker has an action to set UI Drop Down Set Value but I need to set value by string value not index! Is there any way for this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Set UI Drop Down value by string instead of index?
« Reply #1 on: April 01, 2023, 02:54:12 PM »
Hi.
You can have an array with the strings and get the index from there.

in code a dropdown is using index.

So you would do the same thing in code :

https://stackoverflow.com/questions/54020910/setting-drop-down-value-in-unity-with-a-string