Update to Input Processing

Hi Developers,

We recently made an update that improves the frame rate and input latency on iOS, Xbox, Mac, and Android and will be rolling out to all other platforms in the coming weeks.

Part of this change involves processing input twice per frame:

  • Once at the start of the frame.
  • Once after the Heartbeat step.

No action is required unless you have implemented code that relies upon all input being processed before the Heartbeat step. If you have made this change, you would need to take action.

Please let us know if you have any questions or concerns below.

Thank you.

86 Likes

This topic was automatically opened after 10 minutes.

This change has caused issue with being able to “free” / unlock the cursor while the player is in first-person, for example, for a GUI.

Previously, it was possible on Heartbeat to update UserInputService.MouseBehaviour to Enum.MouseBehaviour.Default to achieve this. Now, specifically on Mac, when you attempt to move the cursor it will keep pulling it back to the centre of the screen.

As always, incredibly frustrating as it broke my game on production for all users on Mac, but additionally, there doesn’t appear to be a clear way to get around this without changing the CameraType temporarily to Scriptable, which has all sorts of other side effects.

Is there any clear solution for this, or how is it intended to work around this behaviour? Thanks chief.

16 Likes

I will look into this. If necessary I can temporarily disable this feature for your place.

4 Likes

What is the benefit of processing input after the Hearbeat? The heartbeat is the physics simulation and is the last thing that runs in the frame, wouldn’t the new input on the start of the next frame have more value? And if the concern was input latency, surely unlocking the FPS from 60 (at least increasing the maximum) would help more, no?
I’m aware that some developers tie some systems to the RenderStepped update without using the deltatime variable it passes, so it would vary based on framerate. Since the change affects inputs before heartbeat, it would also be a problem the developers would have to address if the FPS is unlocked. I believe unlocking the FPS, and allowing the user to set their own limit, no limit, or V-Sync framerate would have more benefits with the same need to restructure their RenderStep/Stepped (and modern version of those events).

2 Likes

No worries chief, I’ve already resolved this by now via a hacky method of manually controlling the Camera CFrame & disconnecting from the Humanoid, but I just would like to determine what is a more permanent path to resolving this issue I’m having. Happy to send over some code for you to help reproduce it, if needs be.

The prerender phase now happens after simulation so without the extra input processing, the input latency would be worse.

2 Likes

Is there no way to enable this on Windows in Studio to test our games and if necessary fix them before this rolls out to everyone?

1 Like

Oh that’s an interesting change, thank you for letting me know.

Do you have any examples of this? I didn’t find it anywhere in the post nor the replies so I can get by what the post mean

1 Like

This change doesn’t affect Studio. It is already rolled out to iOS, Android, Xbox and Mac as I wasn’t expecting any problems.

3 Likes

Less latency sounds good to me! One Q, is there or will there be a way I can test this change for my experience before it comes to PC? My exp is currently PC only.

1 Like

I too am dependant on this behaviour on several games. How are we supposed to update UserInputService.MouseBehaviour now?

3 Likes


About 2 years ago, an engineer tweeted out this diagram of frame ordering. So just to clarify, the block representing PreRender would be happening after PostSimulation and before Outbound Replication? Just trying to understand where PreRender fits into frame process ordering now. Or perhaps where the inputs fit into the diagram provided on the Task Scheduler page.

Most of my work is done through UserInputService (UIS)/ContextActionService (CAS) signals alone; when input is processed from those services, I then run other code. If we rely on any continuous action (such as a button being held down), our input manager will only signal to that continuous action to either start or stop; the continuous action itself will not check for input. Would this case qualify as needing to take action?

3 Likes

Are you experiencing any problems currently? Very few devs would need to change their code.

That’s correct regarding the new position of PreRender. We will update the documentation. I don’t think you need to take action but to be sure, you only need to try your code on one of the platforms where this change is active.

1 Like

The pattern that would cause problems would be like this:
UserInputService.InputBegan:Connect(function()
InputThisFrame = true
end)

RunService.RenderStepped:Connect(function()
if InputThisFrame then
– Do something.
end
end)

RunService.Heartbeat:Connect(function()
InputThisFrame = false
end)

4 Likes

The best first step is to see if you have any problems on one of the platforms where this change is active. If necessary I can temporarily disable this change on your places.

There is an input delay for VR controllers. Would this fix that?

There isn’t a way to test PC atm but I can let you know just before this change is activated for PC. That would be at least two weeks from now