Answer the question
In order to leave comments, you need to log in
How to make an immutable Slider in Unity?
In my game, the health bar is implemented using the Slider UI component, but I have one problem: the Fill in the Slider can be moved. Although in my code I wrote in FixedUpdate that: slider.value = hp; but you can still move it evenly, although it immediately returns to its place, but still, it does not look very good. Please tell me how to fix this?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Don't use slider for this, that's all. A progress bar can be made from an Image - it has a Filled fill type.
If you really want a slider - then chop off everything that can catch a click there - remove the Raycast Target from all Image. If this does not help - a mega-crutch - put a transparent image on top, let it catch clicks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question