Circular UI Sliders in Unity - 360 Degrees of Slider Madness

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024
  • เกม

ความคิดเห็น • 12

  • @eneseren8332
    @eneseren8332 17 วันที่ผ่านมา

    Thanks for the tutorial!

  • @BlizStudio
    @BlizStudio  ปีที่แล้ว +2

    Check out my 3rd Person Game Series Playlist teaching you how to make a 3rd Person game using Unity + Playmaker th-cam.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  ปีที่แล้ว +2

      Also check out my other tutorial series

  • @lk-xr3hq
    @lk-xr3hq 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน +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.

  • @redabeg
    @redabeg ปีที่แล้ว +1

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

    • @BlizStudio
      @BlizStudio  ปีที่แล้ว

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

  • @juliaalder2007
    @juliaalder2007 ปีที่แล้ว +1

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

    • @BlizStudio
      @BlizStudio  ปีที่แล้ว +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 ปีที่แล้ว

      @@BlizStudio Thanks a lot. 😊

  • @TimM-kz1vl
    @TimM-kz1vl ปีที่แล้ว

    I always wondered how they made a cirlce slider lol

  • @chenzhuo
    @chenzhuo ปีที่แล้ว +1