x


What is a Fixed Update?

I asked a question a while ago:

http://answers.unity3d.com/questions/13074/player-shakes-on-movement/13163#13163

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?

more ▼

asked Jun 23 '10 at 12:23 AM

Pirate___man gravatar image

Pirate___man
358 6 7 24

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jun 23 '10 at 01:33 AM

Jaap Kreijkamp gravatar image

Jaap Kreijkamp
6.9k 21 30 74

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.

Jun 23 '10 at 02:34 AM Eric5h5

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??

Jun 23 '10 at 02:56 AM Pirate___man

Can I also put a random range for the fixedUpdate() to execute?

May 19 '13 at 05:36 AM dicraft
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x7826
x4315
x127

asked: Jun 23 '10 at 12:23 AM

Seen: 15594 times

Last Updated: May 19 '13 at 05:36 AM