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 zachduer · Mar 27, 2017 at 03:55 PM · raycastinputoculusfocus

Unity loses focus when Oculus display activated

Hi!

I'm running a VR simulation in Unity using the Oculus Rift. I run this simulation in the Unity editor rather than building because the simulation stays in-house and does not need to be distributed. When the Rift goes from standby to active (when the sensor inside the headset is activated), the Unity window loses focus (presumably, focus is shifted to the Oculus app, although the app does not become unminimized and I have no way to verify this). This is specifically a problem for me because when Unity loses focus the Graphics Raycaster stops doing ray casts, which are necessary for my user interface (I'm using the OVRInputModule and OVRRaycaster which sits on top of the GraphicsRaycaster).

This was not happening a couple months ago. I can't say exactly when it started, but I think it happened either with a Unity update or with an Oculus update.

This is extremely inconvenient for me, since I'm running user studies with multiple VR backpacks and I have to remote into the backpacks to control each Unity simulation. As each user puts on and takes off the HMDs, I have to remote into each and click on Unity to restore focus.

Does anyone know how to prevent this, how to automatically give Unity back focus, or how to get the Graphics Raycaster raycast method to continue being called even when Unity loses focus?

Thanks!

Comment
Add comment · Show 2
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 Harinezumi · Feb 19, 2018 at 01:21 PM 0
Share

I have the same underlying issue, the moment the Rift becomes active, Unity loses focus. For me the issue is $$anonymous$$or, because I just want the keyboard to work, but it is still annoying having to click on the Editor to regain keyboard focus.
Have you found a solution on how to fix this? Could EditorWindow.OnLostFocus() help?

avatar image Lukas-Labaj · Jan 17, 2019 at 03:02 PM 0
Share

Did you found a solution for that pls?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jgrif · Feb 20, 2020 at 05:23 PM

I have this exact issue as well and it makes it extremely frustrating to diagnose the new input system because it compounds the problem of needing the Rift S to detect eyes before turning on. steps needed to read console output:

 - hit play in editor
 - put on headset and wait for load
 - lift headset off and click player window to grab focus
 - put headset BACK on to maintain active
 - trigger input even on controller
 - take headset OFF AGAIN to read console or input debugger

I'm more upset that it took me three days to figure out this problem and it was only serendipitously by clicking the window randomly.

I'll be building in a console viewer now to receive debug.log in headset now for sure. if only to cut down on repro steps.

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

6 People are following this question.

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

Related Questions

OpenXR Continuous Turn and Movement not working 0 Answers

InputField focus on PC vs android 0 Answers

(Oculus Rift) Casting a ray from mouse through distortion matrix 1 Answer

Move an object to Input.Touch location 0 Answers

Separating mouse button clicks from GUI and game input 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