Hi. I’m trying to create custom cursor pointer that changes while hovering over an object.
I use this script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CustomCursorPointer : MonoBehaviour {
public Texture2D cursorTexture2D;
private CursorMode cursorMode = CursorMode.Auto;
private Vector2 hotSpot = Vector2.zero;
public void OnMouseEnter() {
SetCustomCursor (cursorTexture2D);
}
public void OnMouseExit() {
SetCustomCursor (null);
}
private void SetCustomCursor(Texture2D curText) {
Cursor.SetCursor (curText, hotSpot, cursorMode);
}
}
apply it to a cube, build the project. When I start the application in fullscreen mode, the pointer uses system cursor only, if I start it in windowed mode, cursor is only custom. In game mode within the editor custom shape appears near the arrow. Is it a bug, known issue or something that I’ve missed out?