Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Easy to use time control for godot.Define multiple clocks to create different timelines foryour nodes.
Godot Time Control Plugin
Easy to use time control for godot.
Define multiple clocks to use different time scales on your nodes.
This plugin heavily inspired by CyberSys/ChronosTimeControl Unity asset.
Compatibility
Godot 4.2+
Documentation
Installation
- Download the latest release.
- Extract the
addons/time_controlfolder to your project'saddonsfolder. - From editor toolbar, go to Project > Project Settings, then in Plugins tab activate TimeControl plugin.
Basic setup
Setup global clocks
The plugin provides a default
ClockControllerautoload scene located inres://addons/time_control/time_control.tscnwhich gives you access to the followingGlobalClockfrom anywhere in your project :- The WORLD clock, the main clock. The other clocks are parented to this clock
- The PLAYER clock, manages the player time scale
- The ENEMY clock, manages the enemies time scale
- The ENVIRONMENT clock, manages the environment time scale on objects such as ambiant particle effects or animated props
These
Clocknodes are automatically registered to their parentClockControllernode, which keeps track of all registered clocks.To customize this scene and the registered global clocks, see Customize
ClockControllerautoload scene.
Setup a
TimelineAdd a
Timelinenode to your scene, and add aClockConfigurationresource to theglobal_clock_configurationfield.Example: If the
Timelineis on your player scene, set theplayer_clock.tresresource (used on the PLAYERGlobalClock) in theglobal_clock_configurationfield.
Use the
Timelinenode in your script.extends CharacterBody2D const Timeline = preload("res://addons/time_control/timeline.gd") const SPEED = 300 @export var timeline: Timeline func _physics_process(delta: float) -> void: var direction = Vector2.ONE velocity = direction * SPEED * timeline.time_scale move_and_slide()Change the time scale from anywhere using
ClockControllerextends Node const ClockConfiguration = preload("res://addons/time_control/clock_configuration.gd") @export var clock_configuration: ClockConfiguration func _process(delta: float) -> void: ClockController.get_clock(clock_configuration).local_time_scale = 0.5or
extends Node func _process(delta: float) -> void: ClockController.get_clock_by_key("PLAYER").local_time_scale = 0.5
Resources
ClockConfiguration
Resource representing a clock.
Properties
key: String
The clock identifier key.
Nodes
Clock
This Node calculates an indenpendant time scale based on the local_time_scale.
If the clock has a parent, the parent time scale is blended with the local_time_scale.
Properties
local_time_scale: float
The current clock time scale. Set this property to modify the clock time scale.
parent_clock_configuration: ClockConfiguration
Optional
Assign a ClockConfiguration resource as a parent clock if needed.
parent_blend_mode: BlendModeEnum
BlendModeEnum.Multiplicative
Default value
Multiply the current clocktime_scaleby the parent clocktime_scaleBlendModeEnum.Additive
Adds the current clocktime_scaleto the parent clocktime_scale
Methods
get_time_scale() -> float:
Returns the calculated time scale based on the local_time_scale and the parent clock time scale.
GlobalClock
Inherits Clock
You can retrieve a GlobalClock node from anywhere with the ClockController autoload.
The ClockConfiguration resource parameter is required.
If you need to access the GlobalClock time scale only, we recommend adding a Timeline node to your scene.
Timeline
Add this node anywhere in your scene to access a Clock or a GlobalClock time scale.
Properties
mode: ModeEnum
ModeEnum.Global
Default value
The Timeline will target aGlobalClockwith theglobal_clock_configurationsetting.ModeEnum.Local
Default value
The Timeline will target aClocknode with thelocal_clocksetting.
time_scale: float
Returns the target clock calculated time scale.
local_clock: Clock
Assign a Clock node. Works with ModeEnum.Local
global_clock_configuration: ClockConfiguration
Assign a global ClockConfiguration resource. Works with `ModeEnum.Global
ClockController
This node keeps track of all GlobalClock in your project and provides methods to get / add / remove them from anywhere in your project at runtime.
Methods
has_clock(clock_configuration: ClockConfiguration) -> bool
Returns true or false if the GlobalClock matching the clock_configuration is registered.
get_clock(clock_configuration: ClockConfiguration) -> GlobalClock
Returns the registered GlobalClock from the clock_configuration
add_clock(clock_configuration: ClockConfiguration) -> GlobalClock
Registers and returns the new GlobalClock
remove_clock(clock_configuration: ClockConfiguration) -> void
Removes a GlobalClock
Customization
Change the ClockController autoload scene
- Copy/paste the
res://addons/time_control/time_control.tscnanywhere in your project - Open the copied scene and apply changes (ie: add / remove global clocks)
- Go to Project > Project Settings > Addons > Time Control and modify the
autoload_pathwith your new scene path.
Example:res://scenes/time_control.tscn - Disable/Enable the plugin or reload project to apply changes
Examples
Check out the demo scene res://addons/time_control/demo/demo.tscn
Easy to use time control for godot.
Define multiple clocks to create different timelines foryour nodes.
Reviews
Quick Information
Easy to use time control for godot.Define multiple clocks to create different timelines foryour nodes.