0
0
Unityframework~8 mins

FixedUpdate vs Update in Unity - Performance Comparison

Choose your learning style9 modes available
Performance: FixedUpdate vs Update
MEDIUM IMPACT
This concept affects the smoothness and responsiveness of game frame rendering and physics calculations.
Updating physics calculations in a Unity game
Unity
void FixedUpdate() {
    // Physics movement code here
    rb.AddForce(force);
}
FixedUpdate runs at a fixed timestep, ensuring consistent physics calculations and smooth motion.
📈 Performance GainStable physics simulation with consistent frame pacing improves perceived smoothness.
Updating physics calculations in a Unity game
Unity
void Update() {
    // Physics movement code here
    rb.AddForce(force);
}
Physics updates in Update cause inconsistent physics steps because Update runs at variable frame rates.
📉 Performance CostCauses jittery physics and uneven frame pacing, leading to poor user experience.
Performance Comparison
PatternFrequencyConsistencyInput ResponsivenessVerdict
Physics in UpdateVariable (per frame)Inconsistent physics stepsGood[X] Bad
Physics in FixedUpdateFixed timestepConsistent physics stepsN/A[OK] Good
Input in FixedUpdateFixed timestepMay miss inputsPoor[X] Bad
Input in UpdateVariable (per frame)Captures all inputsExcellent[OK] Good
Rendering Pipeline
Unity's rendering pipeline separates physics updates (FixedUpdate) from frame rendering (Update). FixedUpdate runs at fixed intervals for physics calculations, while Update runs every frame for rendering and input.
Physics Simulation
Game Logic Update
Rendering
⚠️ BottleneckRunning physics in Update causes inconsistent physics steps, leading to jitter and uneven frame pacing.
Optimization Tips
1Use FixedUpdate for physics to keep simulation stable and consistent.
2Use Update for input and rendering to ensure responsiveness and smooth visuals.
3Avoid mixing physics code in Update to prevent jitter and uneven frame pacing.
Performance Quiz - 3 Questions
Test your performance knowledge
Why should physics updates be done in FixedUpdate instead of Update?
ABecause FixedUpdate runs at a fixed timestep ensuring consistent physics simulation
BBecause FixedUpdate runs every frame for smooth rendering
CBecause Update cannot access physics components
DBecause FixedUpdate is faster than Update
DevTools: Unity Profiler
How to check: Open Unity Profiler, record gameplay, and check CPU usage for FixedUpdate and Update calls. Look for spikes or inconsistent timings.
What to look for: Consistent FixedUpdate timings indicate stable physics; irregular Update timings may affect input responsiveness.