How do I set global variable from dropdown?

0 favourites
  • 6 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hey C3! Hope you're doing well out there.

    Got a simple question that I can't seem to get my brain around. I've got a dropdown box that I've assigned an instance variable of (spot_ID = prod1). Inside that dropdown are a few choices but only one can be selected. When that value is selected and the checkmark (sprite) is left-clicked, the juicerid (global variable) should be set to what the selected text is however this guy can't figure out what I'm doing wrong.

    I appreciate any and all guidance. Thanks in advance.

  • What is it doing instead of the expected outcome? Try picking the list with a different kind of condition, maybe it's picking the wrong one or can't find it if the instance variable is not set correctly.

  • The instance variable isn't being set when I click the checkmark. Does that look like the proper command to capture the selected text?

  • So I tried a couple things here.

    1. I changed the action from left-clicking the checkmark to "Every 1.0 seconds" to set the global variable (juiceprod) using the selected text on the dropdown and

    2. Created an instance variable on the dropdown box and have it set every 1.0 seconds to what the selected text is showing

    This showed the dropdown instance variable being set as I selected different text but the global variable wouldn't set. The juiceprod is set as a string - global variable so I'll do some more testing.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Created a new global variable and it works. No idea why the other global variable wouldn't take the change.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)