0
\$\begingroup\$

Here is the code I used on Cursor script, attached to a chest object.

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);
    }

}

For some reason, I can no longer reset cursor properties and I don't know why. Please help?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You named your MonoBehaviour class "Cursor" so when you write the word "Cursor" inside the body of that class, the compiler thinks you're trying to refer to your MonoBehaviour (which has a method called Start, and no method called SetCursor)

Solution: name your class something that does not collide with other types you want to use, like public class CustomCursor : MonoBehaviour ...

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .