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 /
avatar image
1
Question by NarallandaKaratoga · Jun 15, 2018 at 07:25 AM · uigraphicscursorcursor-customization

How to prevent mouse lag/latency for custom cursor?

(1) VSync is turned off. Turning it on makes no effects.

(2) code here:

 // in the script of the cursor object...
 protected virtual void Update()
  {
     this.gameObject.transform.position = VirtualCursor.position;
 }


 public static class VirtualCursor
 {
     public static Vector2 position
     {
         get
         {
             return new Vector2(Input.mousePosition.x, Input.mousePosition.y)
                 .Clamp(Vector2.zero, new Vector2(Screen.width - 1, Screen.height - 1));
         }
     }
     ........
 }

(3) This video shows the latency is still obvious...

(4) Using OpenGL Core as graphics backend makes it a little better, but not enough.

Comment
Add comment · Show 4
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 Cynikal ♦ · Jun 15, 2018 at 06:42 PM 0
Share

Try doing an actual build, and seeing if the lag is still there.

Testing anything in the unity editor will always not be as 'reliable' as an actual build is.

avatar image NarallandaKaratoga Cynikal ♦ · Jun 17, 2018 at 11:45 AM 0
Share

Oh the build version works great !... The lag is still there but is not so obvious if the original cursor is hidden.... Thanks a lot..

avatar image apizzinischell · Jun 15, 2018 at 07:07 PM 0
Share

What kind of renderer is the cursor? 2D Sprite? $$anonymous$$eshRenderer? UnityGUI?

Try giving the computer a good restart and clear your project temp files?

Side note: I suggest setting Cursor.lockState to CursorLock$$anonymous$$ode.Confined over your coordinate clamping, and using Cursor.SetCursor to simply change the texture used for the cursor.

sorry

avatar image NarallandaKaratoga apizzinischell · Jun 17, 2018 at 11:34 AM 0
Share

It's a UGUI RawImage. Restarting doesn't work. This shouldn't be the case.. Setting lock mode to Confined will really confine the cursor inside the game window, while clamping makes cursor that is not inside the window work as just on the edge of the window.

0 Replies

· Add your reply
  • Sort: 

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

160 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 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 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 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

How to get the current cursor texture? 0 Answers

How do I make my cursor smaller? 2 Answers

Resizing cursor to screen size 0 Answers

How Do I Lock the Cursor to the Center of the Screen? 1 Answer

Cursor Resize? 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