Unity Cursor Not CPU Accessible

I am trying to change the cursor on a unity game but no matter what I do I consistently get this error:

Failed to set the cursor because the specified texture (‘Cursor’) was not CPU accessible.
UnityEngine.Cursor:SetCursor (UnityEngine.Texture2D,UnityEngine.Vector2,UnityEngine.CursorMode)
Player:Awake () (at Assets/Scripts/Player.cs:19)

Here is my code:

public Texture2D cursorTexture;

void Awake()
{
    Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
}

The cursor texture is a 64*64 PNG image.
Any help would be appreciated.

You really should consider dropping your error messages into Google. :slight_smile:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, especially any errors you see
  • links to documentation you used to cross-check your work (CRITICAL!!!)

Are the import settings correct? They should be;

Texture Type: Cursor
Alpha Is Transparent: True
Read/Write : True
Generate Mip Maps: False

9 Likes

That fixed the problem. thank you!

1 Like

Amazing, short and helpful! Thanks!

1 Like
1 Like

Thank you!

1 Like

Ensure that you have change the texture properties as following in Inspector window,

  • Texture Type: Cursor
  • Alpha Is Transparent: True
  • Read/Write: True
  • Generate Mip Maps: False

1 Like

I understand your frustration but the first result of searching this topic is this post

And??? What are the next ten responses?!!!

You actually do notice that there are other responses that Google returns, almost all of them with different workarounds and things to check, right?

If that is not a thing you know then perhaps you need to Google to learn how to use Google.