Follow

Unity: Visual effects should be updated once per rendered frame (Update), but physics should be updated at a fixed rate (FixedUpdate), so the speed of the machine doesn't affect the speed of the game.

Also Unity: Collisions are detected per frame.

(Is this accurate?)

@peterdrake No, to the best of my knowledge, collisions are detected during the FixedUpdate cycle.

@peterdrake FixedUpdate can still skip executions (="frames", I guess?) if the machine is too slow, but it keeps the simulation accuracy more or less constant when the hardware can handle it. Doing physics on Update could theoretically cause expensive calculations to be done up to 20 fps with tiny deltas and even worse, huge jumps if the framerate drops.

@markuslatvala On a related note, I heard about an old console racing game that was ported to Windows. The physics was locked to the framerate, which was fine when all the consoles were identical -- but people with fast PCs found the game unplayable.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.