Search Unity

GvrPointerInputModule requires GvrPointerManager.Pointer to be set

Discussion in 'Daydream' started by msavvy, Feb 7, 2017.

  1. msavvy

    msavvy

    Joined:
    Nov 11, 2016
    Posts:
    5
    I'm stuck and can't figure out what's missing in my attempt to setup a simple controller following these simple steps from SDK Boy:
    1. Running Unity version 5.4.2f2-GVR13 & Google VR SDK for Unity v1.10
    2. Switch to Android platform
    3. Update Player Settings to using VR: Daydream and minimum API to 7.0 'Nougat'
    4. Remove Main Camera
    5. Add GvrViewerMain prefab
    6. Add GvrControllerMain prefab
    7. Create empty Player object at 0,1,0
    8. Add new Camera to Player with 0.03 clipping
    9. Add GvrControllerPointer prefab
    10. Add EventSystem
    11. Remove EventSystem's Standalone Input (fail point)
    12. Add GvrPointerInputModule to EventSystem
    13. Add GvrPointerPhysicsRaycaster to Camera
    Everything works until adding GvrPointerInputModule in step #12, which causes this repeated warning:

    GvrPointerInputModule requires GvrPointerManager.Pointer to be set.
    UnityEngine.Debug:LogWarning(Object)
    GvrPointerInputModule: Process() (at Assets/GoogleVR/Scripts/EventSystem/GvrPointerInputModule.cs:137)
    UnityEngine.EventSystems.EventSystem:Update()

    Any ideas? Thanks in advance!
     
    Last edited: Feb 7, 2017
  2. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    The steps you outlined in your post look correct. However, here is some guidance I can give:

    In the GvrControllerPointer prefab, there is a script called GvrLaserPointer on one of the objects. GvrLaserPointer inherits from GvrBasePointer, which calls GvrPointerManager.OnPointerCreated in it's Start method. GvrPointerManager.OnPointerCreated is what should be assigning GvrPointerManager.Pointer.

    Can you check that GvrPointerManager.OnPointerCreated is correctly getting called? If so, can you verify that you aren't setting GvrPointerManager.Pointer to null anywhere?

    Thanks,

    Dan
     
  3. msavvy

    msavvy

    Joined:
    Nov 11, 2016
    Posts:
    5
    Thanks for your help Dan! I follow the steps above and can consistently reproduce same log vomit every time :(

    I added some debug calls to GvrBasePointer.cs & GvrPointerManager.cs and found that the GvrPointerManager.OnPointerCreated() has a conditional statement checking if (instance != null) that is failing and indeed null.

    Not sure why or how to debug that tho.
     
  4. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    No problem! I think I know what is going on now. I believe you are missing the script GvrPointerManager.

    The instructions you followed were written for a slightly older version of the plugin than the version you are using. The script GvrPointerManager used to be on GvrViewerMain, but it no longer is. We added a prefab called GvrEventSystem that includes the scripts EventSystem, GvrPointerInputModule, and GvrPointerManager all together so that you don't need to set all of this up manually.

    Thanks,

    Dan
     
    greysun likes this.
  5. msavvy

    msavvy

    Joined:
    Nov 11, 2016
    Posts:
    5
    Woot! I swapped out the manually-added EventSystem for a GvrEventSystem and it works now. Thanks!
     
    ybinstock likes this.
  6. Claus79

    Claus79

    Joined:
    Mar 9, 2015
    Posts:
    6
    Hello,
    I'm trying to select an object when gazed at. I have added the GvrControllerMain prefab and replaced with it my older EventSystem, I have also added GvrGaze to the GvrControllermain. I have added an event Trigger on my target object which should call a specific function in the script but the function doesn't get called. What should I do?
     

    Attached Files:

  7. Claus79

    Claus79

    Joined:
    Mar 9, 2015
    Posts:
    6
    The missing attachment
     

    Attached Files:

  8. Claus79

    Claus79

    Joined:
    Mar 9, 2015
    Posts:
    6
    I found the solution here:
     
  9. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    Hey Claus79!

    GvrGaze is now deprecated, I don't recommend that you use it. Instead, you should use GvrPointerInputModule which will work with EventTrigger and can be used with either the daydream controller or the cardboard reticle. More information can be found here: https://developers.google.com/vr/unity/guide

    Thanks,

    Dan
     
  10. greysun

    greysun

    Joined:
    Feb 23, 2017
    Posts:
    9
    Worked for me too!!

     
    dsternfeld likes this.
  11. GHSmediaSrl

    GHSmediaSrl

    Joined:
    Dec 2, 2015
    Posts:
    12
    Update Google VR from 1.0 to 1.20

    As suggested, I replaced the manually added EventSystem with the GvrEventSystem but the warning "GvrPointerInputModule requires GvrPointerManager.Pointer to be set" is still there!! :(
     
  12. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    I'm sorry to hear that!

    Can you verify that GvrPointerManager exists in your scene and that GvrPointerManager.OnPointerCreated is being called?

    Thanks,

    Dan
     
  13. GHSmediaSrl

    GHSmediaSrl

    Joined:
    Dec 2, 2015
    Posts:
    12
    Verified, GvrPointerManager.OnPointerCreated is not called.
    Could be just because we don't use GvrReticlePointer?
    we developed a custom script for raycast detection so we don't need it.
     
  14. dsternfeld

    dsternfeld

    Official Google Employee

    Joined:
    Jan 3, 2017
    Posts:
    72
    If you are doing your own custom raycast detection, then you do not need to have GvrEventSystem in your scene. GvrPointerInputModule requires you to have an implementation of GvrBasePointer in your scene.

    GvrControllerPointer is an implementation of GvrBasePointer intended to be used with daydream to visualize the daydream controller with a laser pointer. GvrReticlePointer is an implementation of GvrBasePointer that is intended to be used for cardboard applications that need a reticle locked to the center of the camera.

    Some additional information can be found here.

    Thanks,

    Dan