Circular UI Sliders in Unity - 360 Degrees of Slider Madness

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 11

  • @BlizStudio
    @BlizStudio  Před rokem +2

    Check out my 3rd Person Game Series Playlist teaching you how to make a 3rd Person game using Unity + Playmaker czcams.com/play/PLhvjMi_0yrQwA0yAkta7hOS7x5zc1hMBr.html and if you would like to join my discord where I can help with issues or you can also engage with other developers please join discord.gg/DgUdNDT7KU
    - - - - The Script for the Animated UI Slider - - - -
    using UnityEngine;
    using UnityEngine.UI;
    public class AnimatedTimerSlider : MonoBehaviour
    {
    public float timerDuration = 30f;
    public Slider timerSlider;
    float timer;
    void Start()
    {
    timer = timerDuration;
    }
    void Update()
    {
    timer -= Time.deltaTime;
    // Animate timer from 1 to 0
    float normalizedTime = Mathf.Clamp01(timer / timerDuration);
    // Update slider
    timerSlider.value = normalizedTime;
    if(timer

    • @BlizStudio
      @BlizStudio  Před rokem +2

      Also check out my other tutorial series

  • @lk-xr3hq
    @lk-xr3hq Před 5 měsíci +1

    Where did you download the hollow circle sprite? Looking for one for my game and I can't find a good one anywhere

    • @BlizStudio
      @BlizStudio  Před 5 měsíci +1

      I just created it myself. You can create in any design app (illustrator, photoshop, etc...). Just create a circle with a line and no fill. Then you can export as a PNG and then import that into Unity.

  • @juliaalder2007
    @juliaalder2007 Před rokem +1

    Would've been a good idea to show the script. 🤔

    • @BlizStudio
      @BlizStudio  Před rokem +3

      using UnityEngine;
      using UnityEngine.UI;
      public class AnimatedTimerSlider : MonoBehaviour
      {
      public float timerDuration = 30f;
      public Slider timerSlider;
      float timer;
      void Start()
      {
      timer = timerDuration;
      }
      void Update()
      {
      timer -= Time.deltaTime;
      // Animate timer from 1 to 0
      float normalizedTime = Mathf.Clamp01(timer / timerDuration);
      // Update slider
      timerSlider.value = normalizedTime;
      if(timer

    • @juliaalder2007
      @juliaalder2007 Před rokem

      @@BlizStudio Thanks a lot. 😊

  • @redabeg
    @redabeg Před 11 měsíci +1

    90% of the time, I was sure you were doing it with PM

    • @BlizStudio
      @BlizStudio  Před 11 měsíci

      Been trying to do some PM but others just general Unity.

  • @TimM-kz1vl
    @TimM-kz1vl Před rokem

    I always wondered how they made a cirlce slider lol

  • @chenzhuo
    @chenzhuo Před rokem +1