How to use flux (easing) library? (SOLVED)

Hi there, im new to defold and lua in general so i need some help.

I have a circle shaped collision trigger object in the middle of the screen and some kinemetic objects moving around. When they hit the trigger they should get pushed back and slowed down over 5sec.

With only one moving object everything works fine, the speed property gets eased to 0 over 5 sec, but more than one and the speed gets to zero in much less than 5sec, like speed is shared through all instances.

here are some cut out snippets from my test code

1 Like

You are calling tween.update() too many times, it should be only called in one script that has only one instance. E.g. have a single main script that will call tween.update() in it’s update() function.

3 Likes

If you want to update it for each object, flux lets you make a tween group.

1 Like

oh, thank you sergey, it works!