- Home /
Performance: Update vs Animation
Hey Guys, In terms of performance, what is taking fewer resources for a constant rotation of many similar objects? Should i use a script with an Update function: transform.Rotate (new Vector3(0,0,Time.deltaTime*rotationSpeed));
Or just use an animation for the objects.
Thank you very much.
Answer by Brocccoli · Mar 16, 2016 at 05:46 PM
This depends on the functionality of whatever you want to spin.
Does the spinning interact with other things in the world. Is it pertinent that other objects in the world know the rotation of the object that you're spinning at every point in time? Or is it just an aesthetic for the ending of a level, or the death of a character?
You need to decide if the fact that the object is spinning is important to other objects in the world or not. The former would call for an Update method for rotation while the latter would call for an animation.
@Guitar$$anonymous$$irby you're very welcome
Answer by vipinsoni38 · Sep 13, 2020 at 06:45 AM
i would say go with Update function because I compared both of these methods by applying on 500 coins and noting fps and Update won this
As you can see below is for the Animation (With Animator component) (32.9 FPS)
and this one is with a script attached to all 500 coins individually (67 FPS)
Answer by SeasiaInfotechind · Mar 17, 2016 at 12:54 PM
Animation is best and uses less CPU or GPU load. If you simply want to rotate only use animation.
Answer by Neogene · Apr 02, 2021 at 05:41 AM
Another solution is to animate using shader this will move the whole pay load to the gpu
Your answer
Follow this Question
Related Questions
What is TA Load in the Android internal profiler? 0 Answers
performance when scaling/duplicating objects 0 Answers
Multithreading doesn’t improve performance 0 Answers
Rendering Transparent Geometry Performance Issue 0 Answers
BehaviourUpdate taking unreasonable amounts of resources in the profiler 1 Answer