Thanks for the hint with the broken call in the inspector. I just pulled up an old project and was wondering why all my sliders didn't work. Your solution fixed it.
You make objectively the best tutorials for Unity on RUclips out of all the people I've seen. Concise and informative, and while there is no "right" way to do something - others so often showcase the wrong ways, non-performant solutions, or solutions that only solve a problem that has limited or no real world applicability. The only reason I ever use literally any other source is because I couldn't find the answer on your channel first. If you can fit it in, please ramp up the content schedule.
Great video. Thanks. One thing that caught me was using the Slider's On Value Changed to call a method in my script where I selected a static parameter versus Dynamic Parameter. My function was being called on every slider change, but being passed 0 regardless of slider position, when I switched to Dynamic parameter everything worked.
Yup, that's a very nice and easy way to set up a health bar. You can also attach it to the actual player object by making the canvas 'world space' and parenting it to the player
@@Tarodev I might do something like that for the enemies, but frankly, I'll finish my Python project first before getting into a strict typed language again...
do you know the exact proportions of the slider fill & background? whenever i try to put any texture into them, it gets stretched even if i turn the image type to filled
When i change slider text (TextMeshPro) change too. How can i save/load or update this text when i start the game again? Text is display as default. I save slider.value as PlayerPrefs.
Can you explain the code please? I don't understand this syntax very well and can't apply this knowledge to my game. What is serialized field? How does this work being that the information is only called on the start method? (at the beginning frame). I see you made a reference but you don't really explain how it's updated and it seems very strange to code with curly brackets within functions.
The serializedfield attribute allows the variable to be visible in the inspector while also remaining private. It works in start as we are subscribing to an event. You only need to subscribe once and can listen to it forever after that. The curly braces in the function is because the function is expecting a parameter of type Action, which is a function. Basically we are saying whenever this slider value changes, please run this code.
Quick question, how can i make it so the slider.value resets to 0? i'm making an idle game and using a slider to show how much time it'll take to spawn things, and that's working fine...the first time around, then the value either goes back to 0 and DOESNT start the process of filling up again, or it just gets stuck in the max value and i cant get it to work
Do you mean once the player lifts their finger you'd like it to go back to 0? The slider itself doesn't have a mouse up event specifically, but you could just hook into your average Input.OnMouseUp event and if the slider has a value you could just do _slider.value = 0; Hopefully I understood your question correctly :)
You could use the sliders value as your speed variable in your calculations. Now there are a million ways to move something, but ill use the absolute simplest for this example: transform.Translate(Vector3.forward * _sliderValue * Time.deltaTime);
@@Tarodev I only have a canvas on screen 2, on screen 1 there is only one level. I have read a lot of document and can apparently work around it using a Rayscaster chart. What concerns me is that this information is from 2014. I don't know if this component is already included automatically when I add a canvas. Tomorrow I can check it. If I am very lucky and it does not add when doing it, it will solve it otherwise I will have to put buttons to add and subtract the values since the buttons do work Thank you very much
Hi, may I know where to find the sprite u use for the fill area and background, and where can I find samples of those Doing a Unity School project at the moment and your videos really helped a lot.
So it just doesn't fucking work THANK YOU, sorry for swearing, I've been battling for an hour until you said in your video that the slider value is just broken!
Thanks for the hint with the broken call in the inspector.
I just pulled up an old project and was wondering why all my sliders didn't work. Your solution fixed it.
It's lucky I used a version of unity which was broken for the video 😂
You make objectively the best tutorials for Unity on RUclips out of all the people I've seen. Concise and informative, and while there is no "right" way to do something - others so often showcase the wrong ways, non-performant solutions, or solutions that only solve a problem that has limited or no real world applicability.
The only reason I ever use literally any other source is because I couldn't find the answer on your channel first. If you can fit it in, please ramp up the content schedule.
Thank you for your kind words 😊
Now Kiss
Finally someone who uses the listener and doesnt just run a string in the update method ty
Great video. Thanks. One thing that caught me was using the Slider's On Value Changed to call a method in my script where I selected a static parameter versus Dynamic Parameter. My function was being called on every slider change, but being passed 0 regardless of slider position, when I switched to Dynamic parameter everything worked.
I just wanted my slider foreground to not stretch, got the answer in 10 secs.
Great video, thanks!
THANK YOU!! I'VE BEEN SEARCHING FOR THE FILL INSTEAD OF STRETCH SOLUTION!
great video man. really helpful and straight to the point! also you explain really well :)
Thanks a lot, my custom fill was stretching and I couldn't understand how to change it until I found your video
Clear and straightforward, thank you!
dude, you're tips videos are awesome
the on value change works just fine in my 2019 unity. just a reminder for everyone
BEST TUTORIAL ON SLIDERS!!!!!
Clear & concise. Thanks man!
short and clear, love it !
Really really good man. Keep it up!
I remember I used the slider to make a 'health bar' on the UI, by just removing the knob and setting the slider's value to whatever I wanted it to be
Yup, that's a very nice and easy way to set up a health bar. You can also attach it to the actual player object by making the canvas 'world space' and parenting it to the player
@@Tarodev I might do something like that for the enemies, but frankly, I'll finish my Python project first before getting into a strict typed language again...
@@qwertyram4598 good luck 😉
ripper video. Thanks
Thank you
great job mate
Thanks a lot!
amazing.
Exactly 4 minutes gooooood.
I'd never lie to you ;)
great tutorial but one question: what's a slidau?
They're only available in 'straya
Same, i've spent 3 hours changing and debugging my code and i can't get the inspector On Value Changed to work.
Can you tell us how you have added the Slider value?
do you know the exact proportions of the slider fill & background? whenever i try to put any texture into them, it gets stretched even if i turn the image type to filled
When i change slider text (TextMeshPro) change too. How can i save/load or update this text when i start the game again? Text is display as default. I save slider.value as PlayerPrefs.
Yup so you could save it in player prefs, then in your start Functuon set the slider value to the retrieved player prefs
@@Tarodev I tried different things, but If it didn't work (example v).
Handy; ty
Can you explain the code please? I don't understand this syntax very well and can't apply this knowledge to my game. What is serialized field? How does this work being that the information is only called on the start method? (at the beginning frame). I see you made a reference but you don't really explain how it's updated and it seems very strange to code with curly brackets within functions.
The serializedfield attribute allows the variable to be visible in the inspector while also remaining private.
It works in start as we are subscribing to an event. You only need to subscribe once and can listen to it forever after that.
The curly braces in the function is because the function is expecting a parameter of type Action, which is a function. Basically we are saying whenever this slider value changes, please run this code.
how can ı reach these sprites
How to save it when you exit the game
Quick question, how can i make it so the slider.value resets to 0? i'm making an idle game and using a slider to show how much time it'll take to spawn things, and that's working fine...the first time around, then the value either goes back to 0 and DOESNT start the process of filling up again, or it just gets stuck in the max value and i cant get it to work
Do you mean once the player lifts their finger you'd like it to go back to 0? The slider itself doesn't have a mouse up event specifically, but you could just hook into your average Input.OnMouseUp event and if the slider has a value you could just do _slider.value = 0;
Hopefully I understood your question correctly :)
Slider is not interactable in my game view, any opinions to fix?
How can I increase or decrease the speed of my object with the slider?
You could use the sliders value as your speed variable in your calculations. Now there are a million ways to move something, but ill use the absolute simplest for this example:
transform.Translate(Vector3.forward * _sliderValue * Time.deltaTime);
Why does noone use UI Builder :( I cant figure it out
How do I move an object with it?
He is the messias! Our saviour after brackeys disappearance
my slider does not work if I have it in my secondary canvas display 2
Is it not receiving input? Could it be blocked by an invisible canvas element on the primary canvas?
@@Tarodev I only have a canvas on screen 2, on screen 1 there is only one level. I have read a lot of document and can apparently work around it using a Rayscaster chart. What concerns me is that this information is from 2014. I don't know if this component is already included automatically when I add a canvas. Tomorrow I can check it. If I am very lucky and it does not add when doing it, it will solve it otherwise I will have to put buttons to add and subtract the values since the buttons do work Thank you very much
@@Guardabarranc good luck my guy!
Video needs the dimensions of the sprites
Hi, may I know where to find the sprite u use for the fill area and background, and where can I find samples of those
Doing a Unity School project at the moment and your videos really helped a lot.
can you revamp this. i didnt get anything at all
What do you mean my guy?
nice explanation without fkn rect transform shit that who knows how to tune
typical
So it just doesn't fucking work THANK YOU, sorry for swearing, I've been battling for an hour until you said in your video that the slider value is just broken!