First person camera movement slows down significantly in Roblox Studio

Recently, whenever I’ve been zooming into first person, the rate at which UserInputService.InputChanged fires for MouseMovement events drops significantly UNLESS I hold down either mouse button. This makes the camera feel stuttery, and makes testing in first person very inconvenient.

To reproduce, create a LocalScript in StarterPlayerScripts and paste this code:

local lastTick = tick()
game:GetService("UserInputService").InputChanged:connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseMovement then
		local currentTick = tick()
		local deltaTick = currentTick - lastTick
		lastTick = currentTick
		
		print(deltaTick)
	end
end)

This will tell you the delay between each mouse movement event while you are moving the mouse. I copied this data from the output to a spreadsheet to show the difference.

As you can see, there are larger delays and spikes in the event firing while zoomed in and not holding down the right mouse button.

This is not an issue with rendering (You won’t see any difference if you change the event to Renderstepped); it’s only UserInputService that is slowing down significantly, but this is bottlenecking camera movement.

2 Likes

@AllYourBlox

Is anyone else able to reproduce this? I cannot. I get an average of about 0.018s between MouseMovement events, with neither camera distance nor mouseButton usage having any effect.

That said, I have experienced issues in Play Solo in the past (possibly still reproducible) where mouse input has large lag spikes after I’ve been testing for a minute or so. Also, for about a week and a half now, on my home PC I have been getting ~36.4 fps in Play Solo inexplicably, even on an empty baseplate. Before this started, I was rarely seeing below 60fps in any place. The MBP seems unaffected, holding 60fps in Play Solo. Is anyone else experiencing this? Client-Server local testing and live game performance are not impacted, just play solo.

1 Like

I just reinstalled Roblox Studio and temporarily disabled all plugins, but I seem to still be having this problem. And I don’t think it’s a hardware issue, since I recently changed my mouse. I also tried unplugging my mouse from my laptop and using the trackpad by itself.

None of this seems to help. The MouseMovement events always slow down when I zoom in, even more so when I’m zooming in and not holding one of the mouse buttons.

I’ll try to investigate this further.

Okay, so specifically, the UserInputService events are being throttled whenever UserInputService.MouseBehavior is set to “LockCenter” or “LockCurrentPosition” (this seems to be the only necessary precondition), and this throttles even more while no mouse buttons are being held. This makes the game nearly unplayable while in studio.

@DataBrain are you still facing this issue?

I’m experiencing something with similar symptoms and I believe I’ve found the root cause; but I want to rule out a relation to this before I go ahead and post a bug report of my own.

I can’t reproduce the repro in the OP, although I’m on a macbook now.

1 Like