Heartbeat and PostSimulation events both have the same description, I’m not sure if they do the same thing but I feel like this is too confusing for people casually reading the documentation.
Hi all,
We appreciate the reports! I’ve updated the RunService page to be clearer on all of these events and when they happen in the scheduler cycle; some new ones are exact equivalents of previous ones, but not in every case… the docs now should clarify those equivalents.
(for some reason PostSimulation is named queryPoint in the microprofiler, but anyway)
This is the LocalScript I used to record them:
local RunService = game:GetService("RunService")
local function logevent(eventName)
debug.profilebegin(eventName)
for i = 1, 10000 do local a = Random.new():NextUnitVector() * math.random(100) end -- extra work to lengthen the frame time
debug.profileend()
end
RunService.PreRender:Connect(function()
logevent("PreRenderEvent")
end)
RunService.RenderStepped:Connect(function()
logevent("RenderSteppedEvent")
end)
RunService.PreAnimation:Connect(function()
logevent("PreAnimationEvent")
end)
RunService.PreSimulation:Connect(function()
logevent("PreSimulationEvent")
end)
RunService.Stepped:Connect(function()
logevent("SteppedEvent")
end)
RunService.Heartbeat:Connect(function()
logevent("HeartbeatEvent")
end)
RunService.PostSimulation:Connect(function()
logevent("PostSimulationEvent")
end)
edit: wrong reply, just wanted to add some extra information and context