UserInputService.MouseIconEnabled disabled mouse but won't enable it again?

What do you want to achieve? Keep it simple and clear!
Custom Camera System, where the mouse is not visible when the mouse is locked to center of screen, and visible when unlocked.

What is the issue? Include screenshots / videos if possible!
UserInputService.MouseIconEnabled can enable and disable the mouse, but once the mouse get’s disabled, even when setting it back to true, the mouse still isn’t visible.

What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried googling the problem but i couldn’t see anyone else with the issue.

function CameraAPI:LockCamera()
	dataTable.MouseLocked = true
	USER_INPUT_SERVICE.MouseIconEnabled = false
	
end
function CameraAPI:UnLockCamera()
	dataTable.MouseLocked = false
	USER_INPUT_SERVICE.MouseIconEnabled = true
end

You will have to provide more context to debug the issue.
I ran

UserInputService.MouseIconEnabled = false

which disabled the mouse, then

UserInputService.MouseIconEnabled = true

which reenabled the mouse. Everything seems to be working fine. You may want to include what dataTable is.

When entering the game, the camera module is loaded, and it locks the mouse, so it does CameraAPI:LockCamera()

The problem is that when you set USER_INPUT_SERVICE.MouseIconEnabled back to true, the mouse is no longer locked but you cannot see it.

https://streamable.com/5jetcl

Try running a separate script that spam-prints UserInputService.MouseIconEnabled in output. If your mouse is invisible while MouseIconEnabled is true, then there is nothing you can do about it.

Must be a bug then, maybe i’ll just try and set the mouse icon to transparent.

MY BAD IM A FAIR IDIOT

RUN_SERVICE:BindToRenderStep(
		"RenderKey",
		Enum.RenderPriority.Camera.Value - 10,
		function()
			if (dataTable.IsEnabled == true) then
				CameraAPI:Update()
				USER_INPUT_SERVICE.MouseIconEnabled = true
			end
		end
	)

This WAS MOST LIKELY the problem