Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by aLeXSQUAD · Aug 23, 2013 at 05:57 PM · maccursorosx

Using custom cursor texture with Cursor.SetCursor() is not working on Mac

Hi, everyone.

I want to use a custom cursor texture in a Standalone application with Unity and I found out that it can be done with Cursor.SetCursor().

It works pretty cool with Windows, but when I test it on Mac the texture it's drawn badly and it looks like it's broken. In Linux the cursor is shown with the system cursor and the custom texture, both at the same time.

Mac

alt text alt text

Linux

alt text alt text

Here is the code I'm using:

 public Texture2D cursorTexture;
 
 void OnMouseEnter()
 {
     Cursor.SetCursor(cursorTexture, new Vector2(5,0), CursorMode.Auto);
 }
 
 void OnMouseExit()
 {
     Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
 }


I don't know if it's because of the texture settings or what. I've already set the Texture Type to "Cursor" and it's not working.

Does anybody have an advice?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by ExplodingCookie · Aug 23, 2013 at 06:37 PM

Recently, Unity has the default cursor option in the player settings. This sets that texture as the cursor. As for the poor drawing, What is the quality setting that your are using? (Fast, Fastest, Good, etc). BTW Posting a picture of the issue would help a lot.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image aLeXSQUAD · Aug 23, 2013 at 07:13 PM 0
Share

I'm using the default quality settings for a Standalone app: "Good"

I've updated the op with the images

Thank you

avatar image ExplodingCookie · Aug 23, 2013 at 07:55 PM 0
Share

How would you apply this script so I can try to replicate the issue.

avatar image aLeXSQUAD · Aug 23, 2013 at 09:28 PM 0
Share

It is applied to a simple Plane with a texture in the scene. The script just have the On$$anonymous$$ouseEnter and On$$anonymous$$ouseExit to change the cursor whenever it hovers the plane in the screen.

The texture changes, but it is shown wrong in both examples ($$anonymous$$ac and Linux).

avatar image ExplodingCookie · Aug 23, 2013 at 11:43 PM 0
Share

Issue replicated. The fix is to change the texture type to Texture.

avatar image aLeXSQUAD · Aug 23, 2013 at 11:58 PM 0
Share

Oh, nice! Thank you very much.

It's working in both Windows and $$anonymous$$ac. But it's still showing both cursors in Linux. $$anonymous$$aybe that's another issue, I guess.

Show more comments
avatar image
3

Answer by Andre-Odendaal · May 11, 2016 at 01:40 PM

As @maccesch said "On newer versions of Unity you have to set the texture type to "Cursor"."

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[OSX] Cannot tab out using Cmd+Tab - Solution? 0 Answers

Screen.lockCursor on OSX brings up Apple menu 1 Answer

Can't run unity 2.6.1 on mac os x 10.6.3 2 Answers

Unity fails to include .bundle for native code plugin when building Intel Mac player. 0 Answers

Xamarin, MonoDevelop 4 or current unity mono? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges