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 mikey113 · Jan 25, 2017 at 09:09 AM · uivr

Unity UI not working using VR Samples plugin after upgrading Unity to 5.4 or 5.5

Hello there. I have a working version of my app in unity 5.3.6 using vr samples prlugin. In my scene i have 3d game object what behave like button using vrinput.cs. I also have Unity build in buttons which works as well.

THE PROBLEM IS after I upgrade unity to higher version. I have tried 5.4 and 5.5 as well. Build in UI Buttons stop working. They dont change color on hover and doesnt respond to my clicks at all.

Is this the normal behaviour or there is a bug? I was not able to read about this anywhere in guideliness. I red in release notes for unity 5.4 about some changes but VR Samples plugin documentation says it si upgraded to the latest version of unity.

Thx for your time

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 jashan · Apr 01, 2017 at 10:25 AM 0
Share

Unfortunately, I cannot give you an answer to this (yet) ... I just found this while looking for an issue that seems to be similar or maybe even the same - except I saw this when going from Unity 5.4.3 to Unity 5.5:

In Unity 5.4.3, by applying a bit of magic, I could make sure that my in-VR laserpointer based UI always worked (the tricky part was getting both the companion Window UI and the in-game UI to work; and in fact, I can only use either one of them, not both at the same time).

In Unity 5.5, however, in-VR laser-pointer UI (using Unity's UI event system) only works when the game has focus.

I have also tried this with various 3rd party solutions (e.g. Vive Input Utility by ViveSoftware, http://u3d.as/uF7), and there I see the same problem: As soon as the VR window loses focus, the laser pointers stop working.

I'm still investigating this and trying to figure out a solution ... if I find one, I'll report back ;-)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jashan · Apr 01, 2017 at 12:38 PM

In Unity 5.5, UT did something very strange: They completely disable their event input system when an application loses focus (on desktop). This means that any hover effects will only work when the game really has focus - and in VR, if your game loses focus for some reason (e.g. because you do something via the SteamVR dashboard), there's really no way to get focus back.

Hopefully, this will be fixed in a later version of Unity - in 5.5, it's not fixed, and I believe in 5.6 it's also not fixed. The way to work around this is to write your own VREventSystem which overrides the stupid stuff that OnApplicationFocus(...) does in Unity 5.5 (activate a "paused" mode).

When using your own VRInput, you may also want to make sure it always is processed, regardless of any other input modules (e.g. StandaloneInputModule).

Here's what I use - please be aware that you cannot simply copy and paste this code and expect it to work because this uses my own MotionControllerInputModule that you probably don't have in your project, but it's easy enough to adapt this to work with your own custom input module:

 using UnityEngine.EventSystems;
 
 namespace NarayanaGames.VR.UI.UnityUI {
     public class VREventSystem : EventSystem {
 
         // IMPORTANT: "MotionControllerInputModule" is the custom VR input module
         //            I am using. You'll usually want to replace this with
         //            whatever laser-pointer / VR-UI input module you are using.
         private MotionControllerInputModule motionControllerInputModule;
 
         protected override void OnEnable() {
             base.OnEnable();
 
             motionControllerInputModule = GetComponent<MotionControllerInputModule>();
         }
 
         protected override void OnDisable() {
             if (motionControllerInputModule != null) {
                 motionControllerInputModule.DeactivateModule();
                 motionControllerInputModule = null;
             }
 
             base.OnDisable();
         }
 
         protected override void OnApplicationFocus(bool hasFocus) {
             /*
              * Don't do anything, it's quite stupid to pause 
              * just because we lost focus. Think of VR :-/
              */
         }
 
         protected override void Update() {
             if (current != this) {
                 return;
             }
 
             base.Update();
 
             // NOTE: We always want to have VR-input being processed
             if (motionControllerInputModule != null) {
                 motionControllerInputModule.Process();
             }
         }
     }
 }
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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Raycast a World Space UI with VR (Daydream) 1 Answer

How to make a 3D interactive map 0 Answers

Why isn't curved UI asset working? 0 Answers

How to display 3D object on top of UI World Space Canvas in VR 0 Answers

Dropdown not working with Oculus 3 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