How to realize this FOR?

Akuma no Tsubasa 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 3


I am currently trying to realize this for in bolt, to learn how everything works.

for(float f = 0; f <= runtime; f += Time.deltaTime) {
LemonSlider.value = Mathf.Lerp(0, 100, f/runtime);
yield return null;

My setup currently is this and I hope it is somewhat right:

Also, would it be possible to make the part of "LemonSlider" a variable, so I can re-use this flow over and over for multiple sliders?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

I don't know how to recreate this for loop exactly like your code.
But I made a macro which lerps a float value. Maybe this helps you.



Thanks! That seems mostly to work. At least the timer counts up perfectly!

But I can't get the value of the slider from 0 to 1.It just instantly jumps to 1 and sticks at 1.

edit: okay I just realized, that you don't throw a float of 1 in but have just the timer as value, so with a max value of 100 it fills up perfectly.

Big thanks!