TIME
https://docs.unity3d.com/Manual/class-TimeManager.html
PROJECT SETTINGS
The time settings in Project Settings allow you to configure four properties that govern timing within the project:
Fixed Timestep --> A framerate-independent interval that determines when physics calculations and FixedUpdate() events occur.
Maximum Allowed Timestep --> A framerate-independent interval that sets a limit on the worst-case scenario when frame-rate is low. Physics calculations and FixedUpdate() events won't exceed this duration.
Time Scale --> This controls the speed at which time progresses. Adjust this value to simulate effects like bullet-time. A value of 1 represents real-time, 0.5 is half-speed, and 2 is double-speed.
Maximum Particle Timestep --> A framerate-independent interval that influences the precision of particle simulation. When the frame time surpasses this value, multiple iterations of the particle update are executed within a single frame to maintain accuracy. For instance, a game running at 30fps (0.03 seconds per frame) could run the particle update at 60fps (in steps of 0.0167 seconds) to achieve a more precise simulation, although this may impact performance.
TIME MANAGEMENT
The Time class offers a few useful properties to help you keep track of time while your game or app is running. Here are a couple of examples:
Time.time --> This property tells you how much time has passed in seconds since your project started running.
Time.deltaTime --> returns the amount of time in seconds that elapsed since the last frame completed. This value varies depending on the frames per second (FPS) rate at which your game or app is running.
Additionally, the Time class lets you control and manage how time flows. For instance:
Time.timeScale --> You can use this property to adjust the speed at which time flows. You can both read and modify this value to create effects like slow-motion.
Time.fixedDeltaTime --> This property controls the regular interval at which Unity's physics engine processes. It's useful for time-based code and maintaining predictability.
Time.maximumDeltaTime --> This property sets an upper limit on the amount of time the engine considers to have passed between frames, ensuring that your time measurements don't get too out of hand.
Last updated