I asked a question a while ago:
And the answer I got was to put my camera movements in a fixed update. How would I do that. And does someone have a better answer for my previous question?
Answer by Jaap Kreijkamp
Jun 23, 2010 at 01:33 AM
Update is called every frame that's drawed.
FixedUpdate is called at fixed intervals (you can define the interval in Edit -> Project Settings -> Time -> Fixed Timestep). It's used internally for Physics and a good place for putting things that should be framerate independent. For example if you made a simple counter and put it in Update it will count slower when framerate drops, not when put in FixedUpdate.
FixedUpdate is pretty much just for physics; use Time.deltaTime in Update to make things framerate-independent. There are several drawbacks to using FixedUpdate for anything else: if you decide you need a different physics framerate, then your code timing changes even though it's not related to physics (trust me, I've been there). Also, Unity tries to make FixedUpdate run at 50 fps or whatever even in low fps situations, which is generally the opposite of what you want. So most of the time you should keep FixedUpdate functions lightweight and only for physics-related code.
I found out the problem. It is the damping on my smooth follow script. But if I turn the damping off I get a lot less natural effect. Solution??
Can I also put a random range for the fixedUpdate() to execute?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
2 People are following this question.
Camera rotate around a moving object: fixedLateUpdate?
The name 'Joystick' does not denote a valid type ('not found')
2.5D SideScroller - Camera shaking on the Y Axis
how to achieve a LateFixedUpdate effect
Animating Unity camera?