iTWEEN makes UNITY run too slow when calling multiple tweens

OK.I decided to build a sound visualizer. I deployed around 60 planes in wall like formation. Each such a plane (tile ) is prefab and has a code on it which reads a spectrum from a audio source than the value from some sample of the spectrum serves as a time for iTWEEN.PunchPosition method,The times range from 0.4 to 2 seconds on each tween.When the tween for a specific tile finishes all the process starts over again. So basically as far as I can say there are around 50-70 tweens running all the time. Now I thought that it really can be too much even for Unity.So I reduced the number of tiles all the way down to 16 .There was a slight improvement but the average FPS was like 16-26 fps.The only thing that really helps here is to make the times of the tweens longer reducing this way frequency of their call.But for sound visualizing this is not a good idea as I need to read the spectrum really fast and convert the data into motion in order to get smooth visual effects. Anybody has an idea how i can optimize this? Is there other tween engines on the market>? may be creating tweens manually will be better solution?

I would suggest using LeanTween. It can support many more tweens than iTween without suffering a performance hit. I did an example test tweening 1,500 boxes and LeanTween zipped along at 250fps while iTween chugged, at times dropping to less than 2fps. You can see my test here.

The engine can be downloaded for free from Unity’s Asset Store.

Are you sure this is a iTween problem? SpectrumAnalysis is a very expensive(performance wise) process, so if you are doing this 60 times per frame this would certainly cause your framerate to drop. Try just removing the tween calls and leave the analysis calls in there to see what it does to your fps.

If the problem is indeed with iTween you should write your own tweening code, as iTween does have a bit of overhead due to its generality. I don't know what punchPosition does, so I can't help you with that.

That quite a lot of iTweens. iTween has a bit of overhead with it's all-in-one design and approach. I would suggested rolling your own solution or perhaps Ani.Mate or even utilizing animations curves. Good luck!

If your objects are moving and they have colliders on them they must also have a rigidbody or you’ll see a big CPU hit due to static collider updates. Since you’re positioning the objects manually (i.e. not via rigidbody physics), make sure also you tick isKinematic true on the rigidbody.

That said, the version of iTween that’s in the store right now (2.0.45) is also extremely inefficient. I can’t recommend using it unless it gets a significant performance and memory overhaul.