Unity Slider in 4 Minutes - [Unity Tutorial]

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 63

  • @nilsmuller-cleve6769
    @nilsmuller-cleve6769 3 года назад +9

    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.

    • @Tarodev
      @Tarodev  3 года назад +4

      It's lucky I used a version of unity which was broken for the video 😂

  • @ZOMGbies
    @ZOMGbies Год назад +4

    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.

  • @bpdhoplite
    @bpdhoplite 4 месяца назад +1

    Finally someone who uses the listener and doesnt just run a string in the update method ty

  • @54egg
    @54egg 7 месяцев назад

    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.

  • @IndicIndieGameDev
    @IndicIndieGameDev Год назад

    I just wanted my slider foreground to not stretch, got the answer in 10 secs.
    Great video, thanks!

  • @rampaga7935
    @rampaga7935 3 года назад +1

    THANK YOU!! I'VE BEEN SEARCHING FOR THE FILL INSTEAD OF STRETCH SOLUTION!

  • @eldanridley7
    @eldanridley7 3 года назад +7

    great video man. really helpful and straight to the point! also you explain really well :)

  • @nullptr.
    @nullptr. Год назад

    Thanks a lot, my custom fill was stretching and I couldn't understand how to change it until I found your video

  • @zhuoyuelyu
    @zhuoyuelyu 3 года назад +12

    Clear and straightforward, thank you!

  • @codastudiode
    @codastudiode 2 года назад +1

    dude, you're tips videos are awesome

  • @ABYZA
    @ABYZA 2 года назад +1

    the on value change works just fine in my 2019 unity. just a reminder for everyone

  • @maksedits933
    @maksedits933 2 года назад +1

    BEST TUTORIAL ON SLIDERS!!!!!

  • @EdLudington
    @EdLudington Год назад +3

    Clear & concise. Thanks man!

  • @nguyenho9835
    @nguyenho9835 3 года назад +4

    short and clear, love it !

  • @jxw7196
    @jxw7196 2 года назад

    Really really good man. Keep it up!

  • @qwertyram4598
    @qwertyram4598 3 года назад +1

    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

    • @Tarodev
      @Tarodev  3 года назад +1

      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

    • @qwertyram4598
      @qwertyram4598 3 года назад

      @@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...

    • @Tarodev
      @Tarodev  3 года назад

      @@qwertyram4598 good luck 😉

  • @Dacommenta
    @Dacommenta 2 года назад +1

    ripper video. Thanks

  • @gdenjoyr
    @gdenjoyr Год назад

    Thank you

  • @luisalarcongames8756
    @luisalarcongames8756 2 года назад

    great job mate

  • @leandrovasquezvega7621
    @leandrovasquezvega7621 Год назад

    Thanks a lot!

  • @AyyoNevNev
    @AyyoNevNev 11 месяцев назад

    amazing.

  • @noobcraft5712
    @noobcraft5712 3 года назад

    Exactly 4 minutes gooooood.

    • @Tarodev
      @Tarodev  3 года назад +1

      I'd never lie to you ;)

  • @mscottveach
    @mscottveach 3 года назад +2

    great tutorial but one question: what's a slidau?

    • @Tarodev
      @Tarodev  3 года назад +2

      They're only available in 'straya

  • @racherim
    @racherim 11 месяцев назад

    Same, i've spent 3 hours changing and debugging my code and i can't get the inspector On Value Changed to work.

  • @shashankmehta8126
    @shashankmehta8126 2 года назад +1

    Can you tell us how you have added the Slider value?

  • @codingidiot6754
    @codingidiot6754 2 года назад +1

    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

  • @jamesxxxyz8775
    @jamesxxxyz8775 3 года назад +2

    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.

    • @Tarodev
      @Tarodev  3 года назад

      Yup so you could save it in player prefs, then in your start Functuon set the slider value to the retrieved player prefs

    • @jamesxxxyz8775
      @jamesxxxyz8775 3 года назад

      @@Tarodev I tried different things, but If it didn't work (example v).

  • @Systemv1
    @Systemv1 Год назад

    Handy; ty

  • @gavinguerette7466
    @gavinguerette7466 3 года назад +4

    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.

    • @Tarodev
      @Tarodev  3 года назад +2

      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.

  • @sercansaglam2608
    @sercansaglam2608 Год назад +1

    how can ı reach these sprites

  • @ralphryanamadaict1162
    @ralphryanamadaict1162 2 месяца назад

    How to save it when you exit the game

  • @sat.chid.ananda
    @sat.chid.ananda 3 года назад +1

    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

    • @Tarodev
      @Tarodev  3 года назад +1

      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 :)

  • @ThalesMML
    @ThalesMML 2 года назад

    Slider is not interactable in my game view, any opinions to fix?

  • @lsdevelopment7055
    @lsdevelopment7055 3 года назад +1

    How can I increase or decrease the speed of my object with the slider?

    • @Tarodev
      @Tarodev  3 года назад +1

      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);

  • @passiv_5602
    @passiv_5602 Год назад

    Why does noone use UI Builder :( I cant figure it out

  • @gabonachohack
    @gabonachohack Год назад

    How do I move an object with it?

  • @arvidpingel
    @arvidpingel 2 года назад

    He is the messias! Our saviour after brackeys disappearance

  • @Guardabarranc
    @Guardabarranc 3 года назад +1

    my slider does not work if I have it in my secondary canvas display 2

    • @Tarodev
      @Tarodev  3 года назад +1

      Is it not receiving input? Could it be blocked by an invisible canvas element on the primary canvas?

    • @Guardabarranc
      @Guardabarranc 3 года назад +1

      @@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

    • @Tarodev
      @Tarodev  3 года назад +1

      @@Guardabarranc good luck my guy!

  • @djcarryout27
    @djcarryout27 8 месяцев назад

    Video needs the dimensions of the sprites

  • @jfanscryptojourney6038
    @jfanscryptojourney6038 2 года назад +1

    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.

  • @retr0breezy
    @retr0breezy 3 года назад

    can you revamp this. i didnt get anything at all

    • @Tarodev
      @Tarodev  3 года назад

      What do you mean my guy?

  • @FAKKER_rap
    @FAKKER_rap Год назад

    nice explanation without fkn rect transform shit that who knows how to tune

  • @lmzsource
    @lmzsource Год назад

    typical

  • @null6209
    @null6209 11 месяцев назад

    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!