Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by mblissmer · Dec 30, 2015 at 02:24 AM · uicursor

Custom cursor not showing up in full screen

Hi all. I've got a strange issue: I've got a png with transparency that I am using for a cursor during part of my game. the "Texture Type" is set to "Cursor" and it works great if you're 1) playing in the editor or 2) playing in a window.

As soon as you start the game full screen (doesn't matter the resolution), the cursor never changes from the default Windows cursor.

Here's the code I'm using to set the cursor. This script is attached to the main camera in every scene. If I want the cursor to be custom, I set a texture, and the script does the rest. Otherwise, I leave the texture field blank, and uses the windows default. I've also tried setting this to the Awake function, with no change.

 using UnityEngine;
 using System.Collections;
 
 public class SetCursor : MonoBehaviour {
 
     public Texture2D cursor;
     private Vector2 hotspot;
 
     void Start () {
         if (cursor != null)
         {
             hotspot = new Vector2(cursor.width / 2, cursor.height / 2);
         }
         else {
             hotspot = new Vector2(0, 0);
         }
         Cursor.SetCursor(cursor, hotspot, CursorMode.Auto);
 
     }
 
 }

Alternatively, if there's a better way I could be doing this, I'd be happy to learn!

Thank you in advance!

Comment
Add comment · Show 1
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 Wrymnn · Apr 18, 2016 at 12:30 PM 0
Share

I can confirm this, not working for me as well, only after switching to windowed and back...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by achynes · May 18, 2016 at 09:28 AM

Confirmed here as well. Anyone cracked this?

Comment
Add comment · Show 1 · 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 Wrymnn · May 18, 2016 at 10:23 AM 0
Share

I think I somehow fixed it. It was in my code where SetCursor() method didnt run, thats why it didnt work. After it got called, the cursor changed even when in fullscreen.

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

45 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Mouse stuck on busy in the compiled version. 1 Answer

[SOLVED] My Cursor Stays Visible When Exiting my Pause Menu Even Though I Have Called the Cursor.Visible Function When Exiting the Menu 1 Answer

What is a proper way to create a Menu for multiple resolutions. 2 Answers

Cursor lock prevents UI interaction 0 Answers

UI text wont highlight 0 Answers


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