Skip to content

Time Controller

Aidan Mathieu edited this page Apr 7, 2026 · 1 revision

This script is used to increase and decrease the speed of the game by increasing the speed of conveyors, machines, points etc. When enabled, the player can increase and decrease the speed of the game using the up and down arrows. This is not normally enabled as the increased speed often causes issues where the interactions between machines and bottles are not as accurate. This inaccuracy is visible to the player. Increased time is really only used when loading certain levels where the line needs to be set to a steady state. As such the game is run with auto ordering at a higher speed.

This script includes public variables and functions that can be referenced by other scripts to ensure that they will work properly when the speed is increased. Instead of just using deltatime when handling time, other scripts will do use deltatime * TimeController.speedMultiplier. This will make it so that when other scripts are determining how much time has passed, they interpret that time has passed relative to the speed of the game.

There is also the WaitCustomSeconds ienumerator within this script which does the same feature as the built in WaitForSeconds, but relative to the speed changes.

Clone this wiki locally