- Home /
Is it unnecessary to use FixedUpdate for a non-physics game?
I am developing a card game for mobile platforms. I don't have any kind of physical components included. I am just using Mathf.Lerp and transform.Lerp and so on. Which kind of Update function should I use for better performance and low battery consumption on mobile platforms?
Answer by Pangamini · Jan 10, 2014 at 04:21 PM
You should use Update() for things that change every frame, for example to achieve smooth motion you should update your card / camera position there. Even if it's not recommended (because of its linkage to physics), you are free to move more computation-expensive logic (or the one that's more dependent on the rate of calling) into FixedUpdate.
For example, let's say you have a Turret gun that aims and shoots. You may then: Use FixedUpdate to calculate angle to the current target Use Update to smoothly rotate gun to that angle Use even slower rate method (InvokeRepeating or coroutine with loop and wait) to test if target is valid / optimal and choose different target eventually
Thanks so much for the clear explanation. Now I understand. I don't get why I got downvoted though : )
Your answer
Follow this Question
Related Questions
FixedUpdate limits: consistant 0.01 s on mobile devices? 1 Answer
FixedUpdate performance doubts 2 Answers
Placing Input.GetkeyDown() inside FixedUpdate() slows down the rate I can fire at 1 Answer
Exact difference between fixedDeltaTime and deltaTime? 3 Answers
how to achieve a LateFixedUpdate effect 5 Answers