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
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.
RUN_SERVICE:BindToRenderStep(
"RenderKey",
Enum.RenderPriority.Camera.Value - 10,
function()
if (dataTable.IsEnabled == true) then
CameraAPI:Update()
USER_INPUT_SERVICE.MouseIconEnabled = true
end
end
)