I’ve been working with my own cursor in unity and it works beautifully except for one small issue, no pun intended. My custom cursor is TINY. I have made sure to set up the proper import settings on the texture and I have the max size set to 256 just to be safe. The image size is 63x63px and I’ve even resized it to 100x100px as a test, yet the cursor is stell VERY tiny in game.
I have found one solution using OnGUI() and DrawTexture using the mouse’s position for the Rect. But that doesn’t seem to work for me, as the texture does not show up for some reason.
Are there any other alternatives to re-sizing the cursor size so I can continue using SetCursor, it’s so much cleaner. The file type for the cursor texture is .bmp, not sure if that may be causing conflicts or not.
I always answer my own darn questions. I apologize for having wasted anyone’s time. Here is a tip for everyone out there who I know is not as dumb as I am. It might be a good idea to make sure the script component is actually turned on while trying to get something to work -______- I feel like an idiot haha. For anyone who comes along with this same issue, for now the solution that worked for me is the OnGUI() methid shown below:
public Texture2D cursorTex;
public int cursorSize = 63;
int sizeX;
int sizeY;
void Awake() {
sizeX = cursorSize;
sizeY = cursorSize;
}
void Start()
{
Screen.showCursor = false;
}
void Update() {
sizeX = cursorSize;
sizeY = cursorSize;
}
void OnGUI()
{
GUI.DrawTexture(new Rect(Event.current.mousePosition.x - (cursorSize/2), Event.current.mousePosition.y - (cursorSize/2), sizeX, sizeY), cursorTex);
}
clearly the cursorSize would be your own size. I set it up the way I did because my crosshair/cursor will always have the same y size as the x size and doing it with the variables I did allows you to scale your cursor size directly from within the inspector with a single variable, however depending on your particular situation you may want to modify that in your own way.