go.animate often returns some unusual values, and often doesn’t actually reach its final value.
If i animate the position of an actor to pos.x + 200, often he will only get as a far 198.99832189. Similarly, even with easing_linear, i find that the animation actually gets slower and slower, so that the last 1% takes as much as the first 50%.
I have physics set to 2D (What are the other options here?) in the game settings, and I’m moving a trigger with all the physics set to 0 (mass, friction, etc.) Strangely, the effect seems to be worse when moving up or right.
The other option for physics is “3D”. 2D means Box2D will kindly simulate your physics, 3D means Bullet will do it. The slowing motion you see can happen if you continuously trigger the animation, like inadvertently restarting it every frame. go.animate should always reach its goal (please let us know otherwise!). There is a known bug where it doesn’t if you set the duration to 0, but IIRC that was only a case for the gui version, gui.animate.
A common mistake for people new to lua is to forget the ‘local’ keyword on functions. This can cause confusing behaviour as you think you call some function in some script, but in fact you are calling another function with the same name.
In fact, the animation was being constantly triggered for about the first 4% of its journey and the last 4% as well.
I have now realised the cases where go.animate did not reach its destination were always cases where the command was re-triggered when the journey was around 96% complete.
In the end, I used a boolean called “moving” which was declared true at the start of the animation, and then declared false when the animation was complete.
Thank you once again for your assistance (I promise this is going to be the best game ever when I’m done).