You make objectively the best tutorials for Unity on UA-cam 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.
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.
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.
dynamic parameter means the Unity Event OnValueChanged is defined with a parameter, meaning we can receive a parameter from the event, So when you add a listener and find your script with the function it can either just trigger the function without passing in anything into the function which would then give a default value (0) for float as float is the parameter you need to receive, In the list of functions you can trigger it shows you the matching params functions as Dynamic Parameter, So once you select that it will now trigger it while also passing the parameter which is set by the slider when invoking the UnityEvent.
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.
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
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
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...
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!
You make objectively the best tutorials for Unity on UA-cam 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
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 😂
Finally someone who uses the listener and doesnt just run a string in the update method ty
BEST TUTORIAL ON SLIDERS!!!!!
great video man. really helpful and straight to the point! also you explain really well :)
THANK YOU!! I'VE BEEN SEARCHING FOR THE FILL INSTEAD OF STRETCH SOLUTION!
I just wanted my slider foreground to not stretch, got the answer in 10 secs.
Great video, thanks!
dude, you're tips videos are awesome
short and clear, love it !
Clear and straightforward, thank you!
Clear & concise. Thanks man!
the on value change works just fine in my 2019 unity. just a reminder for everyone
Thanks a lot, my custom fill was stretching and I couldn't understand how to change it until I found your video
Can you tell us how you have added the Slider value?
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.
dynamic parameter means the Unity Event OnValueChanged is defined with a parameter, meaning we can receive a parameter from the event, So when you add a listener and find your script with the function it can either just trigger the function without passing in anything into the function which would then give a default value (0) for float as float is the parameter you need to receive, In the list of functions you can trigger it shows you the matching params functions as Dynamic Parameter, So once you select that it will now trigger it while also passing the parameter which is set by the slider when invoking the UnityEvent.
great tutorial but one question: what's a slidau?
They're only available in 'straya
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).
Same, i've spent 3 hours changing and debugging my code and i can't get the inspector On Value Changed to work.
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
Really really good man. Keep it up!
how can ı reach these sprites
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 :)
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);
Slider is not interactable in my game view, any opinions to fix?
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!
ripper video. Thanks
great job mate
How do I move an object with it?
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 😉
Thanks a lot!
Why does noone use UI Builder :( I cant figure it out
Thank you
Exactly 4 minutes gooooood.
I'd never lie to you ;)
amazing.
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.
How to save it when you exit the game
can you revamp this. i didnt get anything at all
What do you mean my guy?
Video needs the dimensions of the sprites
He is the messias! Our saviour after brackeys disappearance
Handy; ty
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!