Hello! I am trying to make a custom cursor for my game, however I need to make it change to different cursors when I hover over things. Like text boxes or buttons.
How do I do this?
Current Script:
local userInputService = game:GetService("UserInputService")
local starterGui = game:GetService("StarterGui")
local cursorGui = script.Parent:WaitForChild("Cursor")
local cursorImage = cursorGui.Cursor
userInputService.MouseIconEnabled = false
starterGui:SetCoreGuiEnabled("All", false)
local normalCursor = "rbxassetid://7025168168"
local hoverCursor = "rbxassetid://7025167191"
local textCursor = "rbxassetid://79572790"
while wait() do
if userInputService.KeyboardEnabled then
script.Parent.Cursor.Enabled = true
local mouseLocation = userInputService:GetMouseLocation()
cursorImage.Position = UDim2.fromOffset(mouseLocation.X, mouseLocation.Y)
else
script.Parent.Cursor.Enabled = false
end
end