Custom cursor not showing up in full screen
Hi all. I've got a strange issue: I've got a png with transparency that I am using for a cursor during part of my game. the "Texture Type" is set to "Cursor" and it works great if you're 1) playing in the editor or 2) playing in a window.
As soon as you start the game full screen (doesn't matter the resolution), the cursor never changes from the default Windows cursor.
Here's the code I'm using to set the cursor. This script is attached to the main camera in every scene. If I want the cursor to be custom, I set a texture, and the script does the rest. Otherwise, I leave the texture field blank, and uses the windows default. I've also tried setting this to the Awake function, with no change.
using UnityEngine;
using System.Collections;
public class SetCursor : MonoBehaviour {
public Texture2D cursor;
private Vector2 hotspot;
void Start () {
if (cursor != null)
{
hotspot = new Vector2(cursor.width / 2, cursor.height / 2);
}
else {
hotspot = new Vector2(0, 0);
}
Cursor.SetCursor(cursor, hotspot, CursorMode.Auto);
}
}
Alternatively, if there's a better way I could be doing this, I'd be happy to learn!
Thank you in advance!
I can confirm this, not working for me as well, only after switching to windowed and back...
Answer by achynes · May 18, 2016 at 09:28 AM
Confirmed here as well. Anyone cracked this?
I think I somehow fixed it. It was in my code where SetCursor() method didnt run, thats why it didnt work. After it got called, the cursor changed even when in fullscreen.
Your answer
![](https://koobas.hobune.stream/wayback/20220612054319im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Mouse stuck on busy in the compiled version. 1 Answer
What is a proper way to create a Menu for multiple resolutions. 2 Answers
Cursor lock prevents UI interaction 0 Answers
UI text wont highlight 0 Answers