Performance on 2D only: Animator.Update
Hey guys,
My question can be a little difficult to answer, but I tried every little trick I read about it.
My game (a classic puzzle) needs to have like 600 GameObjects onScreen (purely sprites, no physics, No 3D in my game, imagine a puzzle like CandyCrush). I did everything by the book, designed an Animator with the animation clips and the respective connections.
The thing is, most of the time, my GameObjects are Idle (which is a state in Animator that does nothing).
Problem: Animator.Update takes all the CPU (specially on mobile dropping to about 15fps) even if the Objects are there Idle, If I Spawn the same Objects with no Animator attached, I got no problem with performance, with over 100 fps.
Any ideas how can I workaround this issue?
Answer by Sych · Oct 09, 2015 at 06:38 PM
Well I got the reply by myself. After trial and error, and a lot of days spent, I implemented a workaround where I disable the Animator for my Objects while they are in idle state.
When I change state, I wakeup the Animator for the animation.
On my deploy, got me from less than 15fps to 60+fps constant.
@Sych thanks man, I'll try that. As I tested, it is critical to have more than 600 Animators in one time on hi-end PC, so some disabled Animators will increase the FPS.
Your answer
Follow this Question
Related Questions
How do i make character eyes blink after some seconds have passed? (on 2D sprite) 1 Answer
Keyboard input to Mobile Input 0 Answers
Unity 2D game heats up my phone!!! 1 Answer
Fix Override error 1 Answer
Script Error: OnCollisionEnter2D 1 Answer