- Edited
I'm trying to fix the stamina system in my game, and one issue I have come across is that the stamina_loss signal in the code below will emit based on the framerate of the game because the sprinting mechanic is inside of the _process(delta) since it needs to check if the sprint key is being pressed or not. The issue is, the signal connects to the game HUD in the second image where the stamina is being kept track of, and every time the signal emits 2 is being taken away from the current stamina var. Since the signals emit based on the framerate this results in inconsistent stamina loss which is a big issue. Is there anyway I can force the signals to emit at the same time using delta or some other function? Sorry if this paragraph was a bit confusing.