Hi there,
i try to change the min and max values of a UI Slider by using an atteched script. But as soon as i do that the slider wont react to the mouse anymore.
Here is my code:
using UnityEngine;
using UnityEngine.UI;
public class DamageUI : MonoBehaviour
{
public static float minDamage;
public static float maxDamage;
[SerializeField]
private Slider slider;
void Start()
{
slider.minValue = minDamage;
slider.maxValue = maxDamage;
}
}
When i comment out the contents of the Start method it works again…any ideas?
Thanks!
No worries!
– daniel-eherbert