Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    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,132
    Hi EParent,
    Please check if you've included "using UnityEngine;" in your script.