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
2
Question by scarffy · Dec 01, 2017 at 08:32 AM · uivrload scene

VRTK UI doesn't work after load scene

Hi guys,

I'm having a problem where every time I load to new scene, vrtk's ui stop working. Ui pointer just goes straight through canvas and can't interact at all.

Appreciate if someone shed a light on this for me.

Thank you.

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 Ziderem · Jan 11, 2018 at 06:41 PM 0
Share

finally got it, in the slack channel of VRT$$anonymous$$ they told me this: "Try doing VRT$$anonymous$$_SD$$anonymous$$$$anonymous$$anager.instance.enabled=false; before you switch scenes." -bddckr VRT$$anonymous$$

5 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by PandaFoxProductions · May 29, 2018 at 07:05 PM

I was having the same problem. I was able to resolve it by adding the EventSystem GameObject, that gets auto generated when you add a canvas, to the scene.,I was Having the same Issue, I was able to resolve it by adding an EventSystem object, that gets auto generated when you add a Canvas, into the scene.

Comment
Add comment · Show 1 · 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 krzys_h · Jun 07, 2019 at 08:06 AM 0
Share

Yeah, this is the correct answer - the reason it behaves so weirdly is that SD$$anonymous$$SetupSwitcher also has a fallback copy of EventSystem that it activates if it detects you don't have your own in the scene and that breaks for some reason when changing scenes (you should have your own EventSystem if you are using UI anyway). That fallback EventSystem also prevents Unity from auto-generating it when you add a canvas.

avatar image
1

Answer by boulay_b · May 29, 2018 at 09:22 PM

I had the same problem and after a quick chat on the VRTK Slack I was told that it is related to the Unity EventSystem being disabled and not working properly. I managed to get it work with this script.

 using System.Collections;
 using UnityEngine;
 using UnityEngine.EventSystems;
 using VRTK;
     
 public class MenuFix : MonoBehaviour
 {
     public GameObject EventSystem;
     public VRTK_UIPointer PointerController;
 
     private VRTK_VRInputModule[] inputModule;
 
     private void Start()
     {
         StartCoroutine(LateStart(1));
     }
 
     private void Update()
     {
         if (inputModule != null)
         {
             if (inputModule.Length > 0)
             {
                 inputModule[0].enabled = true;
                 if (inputModule[0].pointers.Count == 0)
                     inputModule[0].pointers.Add(PointerController);
             }
             else
                 inputModule = EventSystem.GetComponents<VRTK_VRInputModule>();
         }
     }
 
     IEnumerator LateStart(float waitTime)
     {
         yield return new WaitForSeconds(waitTime);
         EventSystem.SetActive(true);
         EventSystem.GetComponent<EventSystem>().enabled = false;
         inputModule = EventSystem.GetComponents<VRTK_VRInputModule>();
     }
 }

As you can see, you also have to repopulate the VRTK_VR Input Module component yourself. The PointerController GameObject is my controller with the VRTK_UIPointer component attached to it. The input module is in an array because I have got some issues where sometimes VRTK generate multiple ones in the EventSystem when I enable it. Hope it helps!

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

Answer by codypiercey · Dec 05, 2017 at 09:06 PM

I am also having this issue. I will let you know if I find a solution. When running the scene by itself the UI works fine, however if the scene is loaded it no longer works.

@scarffy

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

Answer by sevag · Jan 17, 2018 at 12:58 AM

Also still having this exact issue, UI Pointer works fine on first scene, but stops working after any scene load using SceneManager.LoadScene, even if it's the exact same scene.


  • I've been using the latest version of VRTK 3.2.1 for this project.

  • I've tried adding 'VRTK_SDKManager.instance.enabled=false;' into script before switching scenes, same results.

  • I've tried adding 'VRTK_SDKManager.instance.enabled=false; VRTK_SDKManager.instance.enabled=true;' into script when new scene loads, same results

  • I've tried disabling/enabling the canvas itself on scene start.

  • I've tried updating Unity to 2017.3.0, same results.


It seems to be some kind of issue with the UI Pointer raycast. I have a script that toggles the straight pointer visibility on/off based on the pointers raycast hitting a canvas object, which no longer works after a scene load.

This is a crucial aspect of the game I'm building, any help would be greatly appreciated. I'll be sure to post any results that I come across.

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

Answer by oumur · Oct 04, 2018 at 03:00 PM

If you disable and enable the VRTK_UI Canvas script (after enabling the UI and the Event handler) it starts working again.

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

156 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

Related Questions

Gear VR Clicking on regular Unity buttons 0 Answers

(Vive) How can I navigate my UI with Vive Dpad? 0 Answers

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

Oculus VR Drag Slider With Finger 0 Answers

OVRInput keys are not working 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