I have a C# event that fires when a timer elapses. When that event fires I set GUI sliders to match the value. But the function that sets the sliders end abruptly on the first line and doesn’t finish the function. Does anyone have had this problem before?
EDIT: I have checked with the VSCode debugger and put two breakpoints at the first and second line of the function. The second breakpoint never triggers and no exception is being thrown in the console.
The function also works as intended when I use it in the Start function.
The sample code that I’m trying to use:
private void SetNeedSliders()
{
_hungerSlider.value = _player.Needs.Hunger;
// Doesn't fire after this line
_thirstSlider.value = _player.Needs.Thirst;
_sleepSlider.value = _player.Needs.Sleep;
_hungerText.text = _player.Needs.Hunger.ToString();
_thirstText.text = _player.Needs.Thirst.ToString();
_sleepText.text = _player.Needs.Sleep.ToString();
}