Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Hololens Input Manager Problem

Discussion in 'VR' started by VeerpalK, Oct 9, 2018.

  1. VeerpalK

    VeerpalK

    Joined:
    Jul 4, 2018
    Posts:
    14
    Hi @JasonCostanza as per your request i have created this new Thread .
    I have 3 Scenes
    1:Base scene
    1.1 containing MixedRealityCamera and Input Manager at one Place as I am having Multiple scenes in my Project.
    upload_2018-10-9_12-36-56.png

    2.1 having Event System using Standalone Input Module as seen here.

    upload_2018-10-9_12-39-16.png
    2:Start Scene
    2.1 Base Scene Load this Scene Additive as
    void Start ()
    {
    SceneManager.LoadScene("StartScene", LoadSceneMode.Additive);
    }

    2.2 This scene contains Play Button which on Click will Loads 3rd Scene having Radio Buttons and Other Buttons.
    public void SwitchScene()
    {
    SceneManager.LoadScene("Main");
    }

    3.Main Scene
    3.1 having set of 3 Radio Buttons with Toggle Group Attached.
    Toggle.PNG
    ToggleInspector.PNG

    3.2 I have Given Reference of Toggle Group as Following.

    ToggleMove.PNG


    3.2 Now I have to do following Tasks
    3.2.1 I have a GameObj G1 and its child as G2.
    3.2.2.On MoveToggle pressed i have to Enable Collider and Script of G1 and Destroy Rotate script of G2 and disable collider of G2.
    3.2.3.Similarly i have to Apply Rotate scipt on G2 and enable its collider and disable Move script and collider of G1
    3.2.4 On 3rd Button i.e None i have to Disable Move script and collider of G1 and Destroy Rotate script of G2 and disable collider of G2.

    3.3 : see here,
    public void MoveToggleHandling()
    {
    if (moveToggle.isOn)
    {
    DisableRotate();
    MovableObj.GetComponent<Collider>().enabled = true;
    MovableObj.GetComponent<HandDraggable>().enabled = true;
    }
    }

    public void DisableRotate()
    {
    if (RotateableObj.GetComponent<Collider>().enabled == true)
    {
    RotateableObj.GetComponent<Collider>().enabled = false;
    }
    if (RotateableObj.GetComponent<Rotate>())
    {
    DestroyImmediate(RotateableObj.GetComponent<Rotate>());
    }
    }

    public void RotateToggleHandling()
    {
    if (rotateToggle.isOn)
    {
    DisableMove();
    RotateableObj.GetComponent<Collider>().enabled = true;
    RotateableObj.AddComponent<Rotate>();
    }
    }

    public void DisableMove()
    {
    if (MovableObj.GetComponent<Collider>().enabled == true)
    {
    MovableObj.GetComponent<Collider>().enabled = false;
    }
    if (MovableObj.GetComponent<HandDraggable>().enabled == true)
    {
    MovableObj.GetComponent<HandDraggable>().enabled = false;
    }
    }


    public void NoneToggleHandling()
    {
    if (noneToggle.isOn)
    {
    DisableMove();
    DisableRotate();
    }
    }

    4.Now the Problem
    4.1.Now the problem is with toggle buttons sometimes they Hangs ,sometimes they need multiple clicks and sometimes these buttons works fine as expected and sometimes they just doesn't disable other buttons functionality and sometimes works fine after some pause.Their behavior is un-natural and unexpected.

    4.2 One thing more when i debug while deploying my app to HoloLens i get the errors like
    a.)ExecuteEvents.cs could not be found.
    b.) ObjectPool.cs could not be found
    c.)StandaloneinputModule.cs could not be found
    Still in that scenario my Other Buttons works fine.

    4.3 May be i think The script attached is not destroyed on Run time is it a right way to Destroy and apply a script on run-time like:
    gameobject.AddComponent<Script1>();
    DestroyImmediate(gameobject.GetComponent<Script1>()); ????
     
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Interesting. Let's have you file a new issue through the bug reporter tool, that way it will attach your project and we can take a closer look. You might have something weird about the way you have it set up but it very well could be a related bug we've seen before. The bug reporter is under the Help menu.
     
    VeerpalK likes this.
  3. VeerpalK

    VeerpalK

    Joined:
    Jul 4, 2018
    Posts:
    14
    I did the same .Thanks
     
    JasonCostanza likes this.
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Do you have the bug number you received?
     
  5. VeerpalK

    VeerpalK

    Joined:
    Jul 4, 2018
    Posts:
    14
    yes I have the one - Case 1089343
     
    JasonCostanza likes this.
  6. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    I will take a look soon and get it to our developers if we're able to reproduce it
     
  7. VeerpalK

    VeerpalK

    Joined:
    Jul 4, 2018
    Posts:
    14
    Thanks