0 votes
value = 100
new value = 200.25
$tween.interpolate_property(self, "value", value, new_value, 2.6, Tween.TRANS_LINEAR, Tween.EASE_IN)

when triggered animation, numbers appear 195.423599 etc
stepify(value,0.01) not help

I want to get only numbers 100.53, 160.62, 195.22 etc

asked May 19, 2019 in Engine by WellStacked (71 points)
edited May 19, 2019 by volzhs

1 Answer

+1 vote
var value = 100

func call_tween(new_value):
    $tween.interpolate_method(self, "set_value", value, new_value, 2.6, Tween.TRANS_LINEAR, Tween.EASE_IN)

func set_value(p_value):
    value = stepify(p_value)
    # do something with value
answered May 19, 2019 by volzhs (9,489 points)

/del

I solved the problem, the error was quite different. But thanks for the help!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.