Crosshair that works like a mouse

So i have been working on my new game coming out soon, but i cant seem to find any tutorials recently that let you have a crosshair that works like a mouse and for a first person game that requires you to pick up items would be alot cleaner if the mouse/crosshair is working, So basically hiding the mouse but the mouse still works, Since it would be in the exact position of the crosshair

I don’t what to do i’ve just started to do roblox games again but i’m confused

Can i have some help?

1 Like

I’m assuming your game is 1st person? If so, you can just change the Mouse icon to a PNG of a crosshair image (it has to be a valid asset ID)

If im right, this should change the icon of your mouse from the default to whatever you set the crosshair image ID to.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local crosshair = "ENTER_ASSET_ID_HERE"

mouse.Icon = crosshair

:warning: NOTE:

some additional things to note from the Mouse.Icon documentation are:

  • The dimensions of the image used determines the size of the cursor.
  • The center of the image is where mouse inputs are issued.
  • The default mouse image is 64x64 pixels, with the mouse taking up 17x24 pixels of space.

let me know if you have any questions!

2 Likes

May i ask where do i put the local script?

Also how can i make my own crosshair/gui

StarterPlayerScripts should work!

1 Like

if you have Photoshop you can use that or you can use Photopea which is a free (but worse) version of Photoshop

You need to use an Image to replace the original Mouse Icon with so you can just make your own on Photopea then export from there as a PNG image then head back to Studio and upload it as an image, get the Asset ID and paste it into the variable I wrote

actually i cant find the asset ids for anything in the toolbox

right click the image of which you want to make the Mouse Icon then click “copy asset id”

1 Like

I just did it, It didnt work? Idk why

ah, my bad. You need to click and take it from the Toolbox into your game and then find the Texture property and copy that instead.

2 Likes

Thanks bro that works now! Yay

1 Like