When creating a Slider in 4.6+'s UI system, a compound object is created:
slider
—background
—fill area
------fill
—handle slide area
------handle
I am attempting to change the “left” and “right” properties of the “fill” object’s RectTransform, such that when the slider’s value is zero, there is absolutely no fill, and when the value is 1, the entire background is covered. Setting the “left” and “right” to zero seems to accomplish this at first glance. However, when I enter play mode, the “left” and “right” values I’ve chosen are reverted to their defaults (-5).
After chasing my tail thinking this was an issue related to the compound slider objects being prefab instances, I have come to believe this isn’t the case. How can I force Unity to respect the changes I’m making to these RectTransforms? I am warned in the inspector for this RectTransform that “Some values driven by Slider” - so how can I circumvent this?
Big thanks,