Start Chrono¶
Chrono runs on top of Roblox's replication by default, so you can drop it into an existing game. Starting it registers player characters and enables Chrono's interpolation.
Call Start once on the server and once on each client:
-- Script in ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
require(ReplicatedStorage.Packages.chrono).Start()
-- LocalScript in StarterPlayerScripts
local ReplicatedStorage = game:GetService("ReplicatedStorage")
require(ReplicatedStorage.Packages.chrono).Start()
Startup order¶
- Apply settings before
Start.Config.SetConfigandConfig.RegisterEntityTypeerror afterwards. See Configuration. - Create entities after
Start.Entity.newerrors before it. Startonly runs once, and running multiple time will warn you.
Waiting for startup¶
Use Chrono.Started(callback) if you have a separate script that needs to wait for Chrono to start before creating entities or accessing configs:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local chrono = require(ReplicatedStorage.Packages.chrono)
chrono.Started(function()
local entity = chrono.Entity.new("DEFAULT", workspace.Goblin)
-- Configs and their server tickers are initialized by now.
end)
Callbacks run once configs are initialized. Registrations made after start is run immediately.
Next steps¶
- Configuration: tick rates, buffers and replication modes.
- Entities: replicating NPCs and other objects.
- Debugger: inspect entities and replication stats.