Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you change the appearance of a cursor in-game?

Asked by 8 years ago

I want to make the cursor in my game have a different appearance along with also having different one when rolled over a clickable object.

1 answer

Log in to vote
0
Answered by 8 years ago

If you want to change the Cursor when putting over a Click detector.

For that you would place a LocalScript in a place like StarterGui

local player = game.Players.LocalPlayer
local character = player.Character
    local character = player.Character
if not character or not character.Parent then
    character = player.CharacterAdded:wait()
end
local mouse = player:GetMouse() 
local Hover = false

mouse.Move:connect(function() 
    local target = mouse.Target --The block the mouse is touching
    if target == nil then
        --Leave empty
    elseif target.Name == "ClickableObject" then --Change this to name of your button
        mouse.Icon = "asdhajsoidjia" --Changes mouse Icon when hovering
                Hover = true
    else
        mouse.Icon = "asdjiasf;k,fgm" --Changes mouse Icon back to normal while not hovering
    end
end)

You would then add a click function while hovering is on, also change the Icon to the ones you want.

Ad

Answer this question