Why are tweening libraries so horifically slow on iOS and what can we do?

I’ve been trying to tween a couple of objects in my game to simulate a lobbed ball, basically moving a horizontal and vertical container, both over a set amount of time, with different easing functions.

I’ve tried iTween - lose 30 fps, just for having 3 tweens on my ipod touch 4g.
Same with HOTween - lose 30 fps the second I execute the tweens.

I tried ANi.Mate, but couldn’t get it to work, which at least saves me from it’s ugly, ugly naming :wink:

So… why is it that this seems to be such a hard thing to do on iOS.

I’ve now found myself from being quite a way through my game to back to the start, as I need to manually write a whole bunch of easing functions, etc, that work in update methods and do not eat 30fps just to move 3 objects …

Anyone got any ideas on what I can do? I’m guessing I’m going to have to basically look inside iTween or similar and lift out the easing code… has anyone got any pointers to any code examples for doing this?

I too had issues with iTween on iOS. Because I was so frustrated by the perfomance hit, and I really wanted to still use a tweening library. I wrote my own library called LeanTween.

You can download it here: LeanTween | Animation Tools | Unity Asset Store

To answer your question; I found the biggest problem with iTween is that for every tween it is instantiating and destroying an object (at least from what I could tell looking through the code). Instantiation is quite an expensive operation in Unity on iOS. So my tweening library avoids this, instantiating all the objects at the beginning of the scene and reusing these objects as needed instead of creating new ones.