• 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 tensoup · May 19, 2021 at 05:49 PM · cursorclicklocklock-cursorlockcursor

Unity 2020+ Project: Cursor Lock Requires Additional Click

I've seen one other variation of this question in regards to this issue from a few years back titled "Cursor Lock requires an additional click" that received no assistance.


I am now running into that same issue in 2021. I have pinpointed this issue in my particular instance as being a direct result of a change in functionality from Unity 2019.3.13f1 to Unity 2020.3.8f1.


I have 2 projects that in every aspect (assets, scripting, name, etc.) are the exact same project, but one is running on 2019.3.13f1 and the other is running on 2020.3.8f1.


Behavior | 2019: Upon clicking the play button the following code...


"Cursor.lockState = CursorLockMode.Locked;"


...automatically locks the cursor to the Game window and does not allow you to click on the inspector unless you press the Esc key. This is the functionality I wish to restore.


Behavior | 2020: Upon clicking the play button the following code...


"Cursor.lockState = CursorLockMode.Locked;"


...causes the cursor stays in the exact same position over the play button. The game is still receiving the X and Y mouse axis, but the cursor is allowed to move freely about the inspector. In order to activate the true mouse lock as seen in earlier versions of Unity the user must click within the game window. While in this state of free movement outside of the game window, all mouse button clicks are registered outside of the game window.


VIDEO EXAMPLE: https://www.youtube.com/watch?v=0nasv4CGepE


Desired Solution: If there is a way to regain the earlier Unity version functionality please let me know. In my opinion it was much more intuitive. Or if a Unity Dev sees this can that functionality please be added into later versions.


There are absolutely no differences between the project used. In one instance I actually used the same project for testing. I had the desired functionality, updated to Unity 2020, and lost that functionality. I'm sure this is probably actually some kind of desired functionality on part of the Unity development team, but it seems to be an issue with a few other people other than me.


Thank you.

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

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

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

Related Questions

"Cursor.lockState = CursorLockMode.Locked" causes Unity to run in slow motion 0 Answers

How do I relock my cursor? 0 Answers

Cursor.lockState Not working unity 2018.2 2 Answers

Cursor.lockState not working on my pc, but the build works for others? 0 Answers

Camera Lock on GUI 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