Forum rules - please read before posting.

Slider bar max value always 1?

edited September 2017 in Technical Q&A
I have set up a custom menu (with source: Unity UI in scene) that consists of a UI slider I'm using as a countdown timer. The player has 20 seconds to perform an action. I have a global float variable set to an initial value of 20. When I enable the menu, an actionlist starts that decrements the variable by 1 every second, then plays a player dialogue when time runs out (and resets the global variable to 20). That all works fine.

My issue is the slider bar itself. No matter what settings I change, its max value always seems to start at 1. Its value will decrement from 1 to 0 (I can see this in the slider bar itself and in the decreasing numbers in the inspector), but it will never have the values of 2-20, even though the variable it's linked to is counting down properly. Am I missing something simple here?

image

image
image


Comments

  • edited September 2017
    Well, I "fixed" it by making the global variable equal to 1 and decrementing it (and therefore the slider bar) by 0.05 each second... that'll probably work fine for my purposes. It looks like something is overriding any manual min and max values set on the slider, though.

    I did find someone else with the same issue when I did a search. The posts are closer to the end of this thread.
  • Thanks, I'll use the images you've posted and try to recreate the issue.  I'll post here if I need more info.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.