Skip to content

Conversation

@ColRealPro
Copy link
Contributor

Changes

I have changed the description of the DeltaTimeSim param to correctly say it is the time since the last simulation step instead of the last frame

local dt1 = game:GetService("RunService").PreSimulation:Wait()
local dt2 = game:GetService("RunService").PreSimulation:Wait() 
print(dt1, dt2) -- almost always outputs the same values, the physics simulation runs at a fixed 240hz afaik which would result in this

Checks

By submitting your pull request for review, you agree to the following:

  • This contribution was created in whole or in part by me, and I have the right to submit it under the terms of this repository's open source licenses.
  • I understand and agree that this contribution and a record of it are public, maintained indefinitely, and may be redistributed under the terms of this repository's open source licenses.
  • To the best of my knowledge, all proposed changes are accurate.

@ColRealPro ColRealPro requested a review from a team as a code owner April 21, 2025 23:05
@github-actions github-actions bot added the engine reference Changes the Engine API Reference documentation label Apr 21, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ColRealPro, thanks so much for helping improve the Roblox creator documentation! Our technical writing team will review your pull request soon. In the meantime, please ensure you've read through the README.md, contribution guidelines, and style recommendations.

@IgnisRBX
Copy link
Contributor

Hi @ColRealPro Could you please explain in more detail why changing it to "simulation step" is more accurate than "frame"? All of the other events for RunService are stated in "frame" terms, so curious why this should be an exception...

@ColRealPro
Copy link
Contributor Author

Hi @IgnisRBX I think that simulation step makes more sense for this because unlike the other events in RunService, this one's deltaTime isn't actually based on the time since the last frame, but rather is always in increments of 1/240 (0.00416, 0.00833, 0.0125) since the physics engine does steps of 1/240, this also means that if your fps is above 240 that PreSimulation may not run every frame as the docs say
image

Technically it's not actually the time since the last step exactly, maybe it should be clarified that it's usually in increments of 1/240?

@IgnisRBX
Copy link
Contributor

Hi again @ColRealPro ,
I made some further edits based on engineer feedback, including updates to PostSimulation and PreAnimation.

@ColRealPro
Copy link
Contributor Author

Hello again @IgnisRBX, I think these changes are great! LGTM

IgnisRBX
IgnisRBX previously approved these changes Apr 24, 2025
@IgnisRBX
Copy link
Contributor

Hi @ColRealPro ,
Just FYI, I also became aware of some confusion that RenderStepped and Stepped were marked as "deprecated" when, in fact, they are not (however they have been superseded by newer events). So, I removed their deprecation notes in this PR as well, and noted that they're just superseded.

@IgnisRBX IgnisRBX merged commit f157e1c into Roblox:main Apr 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine reference Changes the Engine API Reference documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants