Performance: FixedUpdate vs Update
MEDIUM IMPACT
This concept affects the smoothness and responsiveness of game frame rendering and physics calculations.
void FixedUpdate() {
// Physics movement code here
rb.AddForce(force);
}void Update() {
// Physics movement code here
rb.AddForce(force);
}| Pattern | Frequency | Consistency | Input Responsiveness | Verdict |
|---|---|---|---|---|
| Physics in Update | Variable (per frame) | Inconsistent physics steps | Good | [X] Bad |
| Physics in FixedUpdate | Fixed timestep | Consistent physics steps | N/A | [OK] Good |
| Input in FixedUpdate | Fixed timestep | May miss inputs | Poor | [X] Bad |
| Input in Update | Variable (per frame) | Captures all inputs | Excellent | [OK] Good |