Owenskie_77
(SoulessContagious)
September 29, 2024, 7:53am
#1
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
ruckuhs
(ruckuhs)
September 29, 2024, 8:28am
#2
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
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
Owenskie_77
(SoulessContagious)
September 29, 2024, 10:25am
#3
May i ask where do i put the local script?
Owenskie_77
(SoulessContagious)
September 29, 2024, 10:28am
#4
Also how can i make my own crosshair/gui
ruckuhs
(ruckuhs)
September 29, 2024, 10:31am
#5
StarterPlayerScripts
should work!
1 Like
ruckuhs
(ruckuhs)
September 29, 2024, 10:32am
#6
if you have Photoshop you can use that or you can use Photopea which is a free (but worse) version of Photoshop
ruckuhs
(ruckuhs)
September 29, 2024, 10:34am
#8
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
Owenskie_77
(SoulessContagious)
September 29, 2024, 10:35am
#9
actually i cant find the asset ids for anything in the toolbox
ruckuhs
(ruckuhs)
September 29, 2024, 10:35am
#10
right click the image of which you want to make the Mouse Icon then click “copy asset id”
1 Like
Owenskie_77
(SoulessContagious)
September 29, 2024, 10:37am
#11
I just did it, It didnt work? Idk why
ruckuhs
(ruckuhs)
September 29, 2024, 10:39am
#12
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
Owenskie_77
(SoulessContagious)
September 29, 2024, 10:41am
#13
Thanks bro that works now! Yay
1 Like
system
(system)
Closed
October 13, 2024, 10:41am
#14
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.