So out of curiosity, I’ve been trying to get more deep into the Luau programming language knowledge. And on the roblox wiki I found out about the “RenderPriority” enums of the RunService. Whick look like this:
RenderStepped is an event that fires every frame prior to rendering. A frame is a unit during which tasks are performed by the task scheduler in particular order. Input registration is first, followed by tasks bound to RenderStepped, later follows replication, resuming of wait-states, then physics simulation and so forth.
Out of the famous three events - RenderStepped, Stepped and Heartbeat, the first one is relatively sensitive and may significantly impact the client’s performance, especially if heavy and demanding operations are performed before the screen drawing.
Now, the difference between RenderStepped and :BindToRenderStep() is, the latter gives us the option to specify priority, therefore we can decide where in order our additional task should be executed, while RenderStepped doesn’t come with such guarantees.
Here is every value in Enum.RenderPriority at the time of writing:
Apparently there are 2001 places in order (much more then we would ever need), and Enum.RenderPriority.First.Value simply means no bound operation is going to run before the given task.