Heartbeat and PostSimulation have the same exact description

image
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.

Page URL: https://create.roblox.com/docs/reference/engine/classes/RunService#Heartbeat

1 Like

Thanks for the report! I filed a ticket in our internal database.

1 Like

PostSimulation is meant to be a replacement for Heartbeat.
The reason is probably to have a more sleek naming convention.

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.

At a high level:

  1. PreRender (RenderStepped)
  2. PreAnimation (new)
  3. PreSimulation (Stepped)
  4. PostSimulation (new)
  5. Heartbeat

Take care,
IgnisRBX

2 Likes

Hi @PeZsmistic,
Please see my response above, as it’s a bit more nuanced with the “new” events vs. the previous ones. :upside_down_face:

IgnisRBX

1 Like

Hi @hellohennessy ,
Please see my post above. It’s a bit more nuanced and PostSimulation doesn’t replace Heartbeat 1:1. :slightly_smiling_face:

IgnisRBX

Hello! Upon further inspection using the microprofiler, this is the actual ordering of the events (order is the same on all frames):

  1. RenderStepped
  2. PreRender
  3. PreAnimation
  4. Stepped
  5. PreSimulation
  6. Heartbeat
  7. PostSimulation

    (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

1 Like

Thanks Ignis! I appreciate you taking the time to look into this issue, take care!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.