playMaker

Author Topic: Create 'Dropdown' variable in FSM? [SOLVED]  (Read 678 times)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Create 'Dropdown' variable in FSM? [SOLVED]
« on: April 14, 2021, 09:07:05 AM »
Hi Playmakers!

Is it possible to create a 'dropdown' variable?

What I want to do is have an 'Input' variable (visible in Inspector), where you can use a dropdown menu to choose between pre-defined game objects.

In this case, I want to choose between Snap Points (Default, Hand, Head, etc). I'd like the choice to be from a pre-defined list of options chosen in a dropdown menu.

Thanks!

*EDIT: Attached mockup of what I want to achieve:
« Last Edit: April 14, 2021, 09:37:00 AM by ToxicFrog »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Create 'Dropdown' variable in FSM?
« Reply #1 on: April 14, 2021, 09:33:35 AM »
Hi.
you could create an enum and inside the fsm you can use the index or enum switch.
and expose the enum

creating a enum script is very simple :



for the items in an enum you don't have to set index number, but if you want to change the order of your list its good to have these as it might break existing selections (the index is remembered, not the name)

so you can set a NameSpace

and then as many enum lists you need.

there is also a enum wizard in the playmaker top menu, but i prefer to manually do this :)

ToxicFrog

  • Beta Group
  • Full Member
  • *
  • Posts: 139
Re: Create 'Dropdown' variable in FSM?
« Reply #2 on: April 14, 2021, 09:36:45 AM »
Perfect!
Thanks, djaydino!

This tutorial showed me everything I needed to do this: