Unity: Cursor does not contain definition SetCursor

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cursor : MonoBehaviour

    public Texture2D cursorArrow;
    // Start is called before the first frame update
    void Start()
        //Cursor.visible = false;

        Cursor.SetCursor(cursorArrow, Vector2.zero, CursorMode.ForceSoftware);


I’m attempting to change the cursor to a custom cursor programmatically and Unity 2019.47f1 states the cursor does not have the property visible (which is nonsense) and similarly won’t let me change the cursor using the above method, which worked flawlessly for the video editor back in April 2019.

It looks like what you’re having here is name conflict. You’ve created a class called “Cursor” which inherits from monobehavior. This hides the Cursor class from unity. So when you’re calling

Cursor.SetCursor(cursorArrow, Vector2.zero, CursorMode.ForceSoftware);

You’re not actually calling it on the class defined by unity, but on your monobehavior.

Simply rename your monobehavior to something like this, this should fix the issue.

public class CursorManager : MonoBehaviour