Tag Info

New answers tagged

0

You should update the relativePosition inside your FixedUpdate function. If you don't the behaviour will have different results depending of your FPSs.


2

Update is called as fast as possible. The variable 'Time.deltaTime' is set to the actual amount of time that passed since the last call. If lag or something similar slows down the game, Update will still be called only once once the lag is over, with a high value of deltaTime. FixedUpdate is called at regular intervals. It will never be called more often ...


7

I was going to write this as a comment, but it ended up being rather long winded so I've turned it into an answer. The current answers are mostly correct, but a few things mentioned are misleading/wrong. In general, most game-play related tasks will go in Update. For example, you don't want to be polling for input in FixedUpdate (not because of ...


4

The Update function is called every frame. Its frequency depends on how fast the computer is able to render images. On a slower computer, Update is called less frequently than on a faster one. If you do time-based calculations, you can normalise them using Time.deltaTime which tells you how long it has been since the last time Update has been called (caveats ...


2

From: http://unity3d.com/learn/tutorials/modules/beginner/scripting/update-and-fixedupdate The time-step used in FixedUpdate is not variable. If your game starts to lag, when it catches up, you don't want >10seconds of physics in one update, so it is typically done in FixedUpdate which is called on a fixed-interval. For example: Update(float ...



Top 50 recent answers are included