Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Problem with Cursor.SetCursor

Discussion in '5.5 Beta' started by EParent, Sep 1, 2016.

  1. EParent

    EParent

    Joined:
    Feb 13, 2015
    Posts:
    36
    Hi,
    I have a problem. I have a script who change my cursor when i'm over a button. I used this script for the oldest version, but in Unity 5.5.0b1, Unity give me this error :

    `Cursor' does not contain a definition for `SetCursor'

    Here's my code

    public Texture2D cursorTexture;
    public CursorMode cursorMode = CursorMode.Auto;
    public Vector2 hotSpot = Vector2.zero;

    Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);

    Someone can help me ?
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,021
    Hi EParent,
    Please check if you've included "using UnityEngine;" in your script.