dt in Value Tracker fails #3993
-
Hey I tried to set a ValueTracker with am updater that is using the Here is a short example that show that the Value Tracker isn't updated by using the dt parameter, but using the self.renderer.time works.
Updater_dt_Scene.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With Over on Discord I could have directly demonstrated this in a live code example... |
Beta Was this translation helpful? Give feedback.
dt
is the time difference between the current and the previous frame. It is equal to 1/framerate.With
value_tracker1.add_updater(lambda m,dt: m.set_value(dt))
you are setting the value of the value tracker to the valuedt
over and over again. Tryvalue_tracker1.add_updater(lambda m,dt: m.increment_value(dt))
for a cumulative updating...Over on Discord I could have directly demonstrated this in a live code example...
https://docs.manim.community/en/stable/faq/general.html?highlight=discord#where-can-i-find-more-resources-for-learning-manim