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
0
Question by Rakatan23 · May 13, 2014 at 08:43 PM · mousemaccamera-look

Mac version mouse lock not working properly

We have a script that switches cameras on the fly. One camera has an unlocked mouse and the other has a locked mouse. On the mac version, when the mouse is unlocked, any movements made while unlocked will be cached so that once the mouse is re-locked, the camera instantly reads the cached information and moves the camera's position.

         Quinn.gameObject.SetActive(false);
         UI.camera.gameObject.SetActive(false);
         Valor.camera.gameObject.SetActive(true);
         skyCam = true;
         cameraNumber = 1;
         QuinnActive = false;
         Screen.lockCursor = false;
         SendMessage("setActive");

This one switches the perspective from the first person camera to the overhead camera and unlocks the mouse. The one below switches cameras back to the first person camera and re-locks the mouse.

         Quinn.gameObject.SetActive(true);
         UI.camera.gameObject.SetActive(true);
         Valor.camera.gameObject.SetActive(false);
         skyCam = false;
         cameraNumber = 0;
         QuinnActive = true;
         Screen.lockCursor = true;
         SendMessage("setInactive");

This is where the issue is happening. On the Windows version, this works just fine, re-locking the mouse to the center of the screen without any extraneous movement, but on the Mac, as soon as the switch happens the first person camera will read in the mouse movements and snap the first person camera.

Is this something I can fix in the code or would I have to put in Mac specific commands in order to fix the issue. If so, can I do that with the free version of Unity?

Thanks

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 Ildefonse · Sep 26, 2014 at 01:12 AM 0
Share

Having this same issue. Did you ever find a solution or work around for this problem?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by doublegumbo · Oct 17, 2017 at 07:49 PM

dealing with this now. was this ever answered?

Comment
Add comment · Show 3 · 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 PizzaPie · Oct 17, 2017 at 07:54 PM 0
Share

try Cursor.lock$$anonymous$$ode as Screen.lockCursor is depricated if am not mistaken.

avatar image Crispinator · Oct 17, 2017 at 10:34 PM 0
Share

I noticed this issue a while ago as well. For my issue in particular, it was not properly locking the mouse whilst in the editor. However, when I built my project and tested it, there was no issue. Other than that, the previous comment is also accurate. Replace Screen.lockCursor with Cursor.lock$$anonymous$$ode.

avatar image doublegumbo · Oct 17, 2017 at 11:39 PM 0
Share

I am using Cursor.lock$$anonymous$$ode - the issue persists.

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

24 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

Related Questions

Why is a Unity Demo not working on Macintosh? 1 Answer

Having both mouse orbit and smooth follow work at the same time? 0 Answers

Having a little issue with a script ... A script to hide the mouse, ("Parsing Error" and "Unexpected Symbol 'else' ") The script works now :) 3 Answers

MonoDevelop is not opening on my laptop 0 Answers

Erratic movement problem 2 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