Godot Version
4.4.1
Question
Why is snapped($Timer.time_left / 60, 1) giving me 5 at 290 seconds remaining. at 4:30 it goes down to 4 like it should’ve originally
please help I am very confused
4.4.1
Why is snapped($Timer.time_left / 60, 1) giving me 5 at 290 seconds remaining. at 4:30 it goes down to 4 like it should’ve originally
please help I am very confused
Hi,
According to the documentation:
Returns the multiple of step that is the closest to x. This can also be used to round a floating-point number to an arbitrary number of decimals.
290/60 equal 4.8333, to which 5 is closer than 4, so there’s no issue here imho.
Instead of snapping with 1 as step, you should have a loot at ceil(), floor() and round(), which I believe are better fit for what you’re apparently trying to do.
Feel free to give more context about what result you want if that does not help.