Mouse Cursor disappears when using script

Hey devs!

So to be honest I totally suck at scripting. I can do only the very basics. I wanted to make the camera movements and walking similar to popular Roblox game Doors. Because as I said I can’t script properly I stoled script from a tutorial on YouTube. Everything in the script works perfectly, but the mouse cursor disappears which isn’t great for my game.

I wanted to ask if anyone could help me with this one. What part of the script I should delete or which add.

I already tried reading the script by my self, but was not able to find the part which may cause it.

local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")

local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local Turn = 0

local Lerp = function(a, b, t)
	return a + (b - a) * t
end;

RunService:BindToRenderStep("CameraSway", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
	local MouseDelta = UserInputService:GetMouseDelta()

	Turn = Lerp(Turn, math.clamp(MouseDelta.X, -7.5, 7.5), (7 * deltaTime))

	Camera.CFrame = Camera.CFrame * CFrame.Angles(0, 0, math.rad(Turn))
end)

(There were 2 scripts in the tutorial, but I think this one is more likely to cause it.)

I will be really thankful for any comments.

(I also added video so you can see what I exactly mean. The video is uploaded the Google Drive because its too big.)
The video: Untitled.mov - Google Drive

Thanks in advance!
-jeziskrista

1 Like

I tested the code, and it doesn’t seem to be the issue.

Look for a LocalScript that gets the mouse. Specifically look for “:GetMouse()”

local mouse = plr:GetMouse() -- This line gets the mouse
mouse.Icon = script.CursorImage.Texture -- This line changes the appearance of the cursor
2 Likes

As the person above me said, look for either the Mouse object or UserInputService.MouseIconEnabled

1 Like

Thank you! I will for sure try that.

I will try it, and follow up with an update.

I think I found it. UserInputService.MouseIconEnabled = false

What should I put there instead of false?

You can just delete the line or replace false with true.

1 Like

Hey! Sorry for late response. Thanks you so much for your help! It worked.