I want the Slider value to be zero once you release the handle.
How can you achieve this?
I want the Slider value to be zero once you release the handle.
How can you achieve this?
This does the trick:
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class Val : MonoBehaviour, IEndDragHandler
{
private Slider me;
void Awake()
{
me = gameObject.GetComponent<Slider>();
}
public void OnEndDrag(PointerEventData data)
{
me.value = 0f;
}
}
if i need slowly or smoothy?