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

How to use Cardboard Reticle: VR Gaze Pointer/Cursor, Cardboard Button, & Gaze Input

Discussion in 'AR/VR (XR) Discussion' started by Selzier, Feb 26, 2016.

  1. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
  2. skcalanderson

    skcalanderson

    Joined:
    Mar 23, 2016
    Posts:
    1
    Thank you for this I found it super helpful. Just FYI, not to be an a** but reticle is pronounced ret-i-cl. Otherwise nice work.
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Lol I hate this word :D Thanks!
     
  4. FaramirTFK

    FaramirTFK

    Joined:
    Feb 23, 2016
    Posts:
    10
    Great tutorial Selzier, thanks!
     
    Selzier likes this.
  5. murat-tanrikulu

    murat-tanrikulu

    Joined:
    Feb 23, 2016
    Posts:
    7
    hello Selzier. i wonder if i can move camera to cube position at same tecnique. i mean when i look box few second camera move to box coordinates ( not box move up).
     
  6. murat-tanrikulu

    murat-tanrikulu

    Joined:
    Feb 23, 2016
    Posts:
    7
    please help
     
  7. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Yes, gameobjects are moved through their transform.position. So you could change the camera.transform.position instead of the box.
     
  8. rebelle31

    rebelle31

    Joined:
    Nov 28, 2015
    Posts:
    1
    hi i do all what you do in the video but the pointer don't change when i look to the cube ?
     
  9. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Google Cardboard has updated to 0.7 which made it where you must add an Event Trigger component in order for the Gaze to respond. Now it was just updated to 0.8 so I need to check what may have changed.
     
  10. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hi I'm looking for implementing Gaze function into Unity Slider UI, but since it could not get gazed position, it was not successful. I am using Event Trigger(Point Enter) to get the input.

    Any idea for using gaze with Unity Slider??
     
  11. ExtraFine

    ExtraFine

    Joined:
    Jun 20, 2016
    Posts:
    1
    The Tutorial is good but I had a View problems.
    Current version of the Unity SDK is 0.8.1 where all components prefixes are changed from Cardboard to Gvr.
    My main problem was that the Reticle wasnt scaling when I hovered over the Box.
    My EventSystem, PhysicRaycaster, Reticle and Cube were all set up the same but nothing happend. The Reticle just snapped a bit to the left.
    It seems that in SDK 0.8.1 the Reticle only scales when there is an EventListener attached to the targeted object. Otherwise it wont work.
     
  12. untipofeliz

    untipofeliz

    Joined:
    Jun 16, 2016
    Posts:
    1
    Hi guys! Seizier, first of all, thank you very much for the tutorial. It´s crystal clear.

    I´d like to ask if this technique could be used to trigger an opening door animation (a Cinema4D imported one, divided in "open" and "close" clips.).

    It would be a blast if you could give some insight about this.

    Thank you again for your work.
     
  13. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    HI, you say that 20 pixels is enough as well as being default but I have tried setting mine to 200 and still when I look through VR the reticle is very jagged and pixelated?
     
  14. Zygor1

    Zygor1

    Joined:
    Aug 16, 2016
    Posts:
    1
    Hi Selzier - your tutorial on reticles helped me a lot thanks. But there is one thing I can't do and I have tried everything I know. You showed how to make the reticle disappear once it exits the cube. That works. I thought it would be easy to generalize and make it disappear initially and not show itself until and only if I enter the cube. But there is a block in every direction for doing this. Do you know how to do this? Would greatly appreciate.
     
  15. farki

    farki

    Joined:
    Sep 9, 2016
    Posts:
    1


    Updated video
     
    luisquid and Selzier like this.
  16. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Thanks farki! :)

    @Zygor1, I did create a fix for this problem that you describe. It was very annoying, I understand your problems, send me a message if you're still trying to fix that.
     
  17. lipsa

    lipsa

    Joined:
    Sep 15, 2016
    Posts:
    1
    hello Selzier... i need ur help
    i created one project in which when i my pointer enter in button ...loadingbar start loading but when defocus button how automatic stop loader/progressbar .
    i also try pointerexit but cant work...can u help me .....plz
     
  18. AlanAmorim

    AlanAmorim

    Joined:
    Nov 11, 2016
    Posts:
    1
    thaks for tutorial
    i have a problem with GVR reticle
    Has a target object, which when it interacts with it, it is destroyed, "Destroy.gameobjet (2.f);" But the reticle remains open, as if the object was active, as if it were still looking at a selectable object. How to make the circle close ??
     
  19. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    So I don't remember exactly but I think that GazeInputModule does not handle this situation. It assumes that there will be a OnPointerExit event, so it's waiting for that to happen. I had to modify GazeInputModule (or was it the reticle script?) so that it checks the selected game object and if it's null, set reticle back to normal or fire a pointerexit event
     
  20. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    38
    Great tutorial, honestly. Been searching all around for a way to implement cardboard and every tutorial I've seen is outdated or simply doesn't work right. Keep them coming! :D:D:D
     
    Selzier likes this.
  21. StripeGuy

    StripeGuy

    Joined:
    Dec 30, 2016
    Posts:
    52
    Amazing tutorials. Very genuine. But the reticle gaze doesn't seem to work on the latest version of unity. It's also saying that Gaze Input Module is depricated.
     
    brackenboy9 likes this.
  22. Tunkali

    Tunkali

    Joined:
    Feb 5, 2013
    Posts:
    54
    @nurface

    Do you know how I can use touch buttons (eg. going to mainmenu)? I use GVR 1.0 and I am very desperate :-(.
     
  23. fatbluefred

    fatbluefred

    Joined:
    Sep 30, 2016
    Posts:
    3
    If you are using the legacy GVRMain rather than the new GvrViewerMain (I'm doing this because I have stereoscopic images I need to cull for Left/Right Eyes) in GVR1.1 then you need to add the GVRpointerManager to the GvrMain

    ALSO, you need to add the GvrPointerPhysicsRaycaster to the mainCamera, not the unity Raycaster for it to work.
     
    seasun11 likes this.
  24. aorata

    aorata

    Joined:
    Feb 10, 2012
    Posts:
    28
    I am running the same game on iOS and Android. On iOS it runs at 60 fps, and on Android it runs barely at 25 fps. Why ? does cardboard vr plugin have issues with android? ANY IDEASS? PLEASE help me
     
  25. Figwan

    Figwan

    Joined:
    Nov 8, 2016
    Posts:
    1
    I have a very silly question :
    - How do you test your prototype with the mouse control instead of having to wear the cardboard every time??

    I could write a script that gets mouse position blahblah but I figure you must have added a simple component that will do it for me..

    Any help appreciated :)
    Thanks
     
  26. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Hold ALT to rotate head and CTRL to tilt head.
     
  27. moodiey

    moodiey

    Joined:
    Jan 4, 2017
    Posts:
    16
    Selzier! Thanks for the great tutorials, they are straight to the point and the best by far (ive watched alot)

    I've gotten my events to work when gazing on objects, on pointer down ect... but I want to be able to fire an object along the vector of my gaze / raycast as defined in GvrPointerPhysicsRaycaster script (at any time).. should I think about accessing the vectors in that script to accomplish this? if so how? (they are all protected). Easier way?
     
  28. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Hey there, thanks moodiey! If you just need to fire an object in the direction of the gaze, I would access Camera.main.transform.forward
     
  29. moodiey

    moodiey

    Joined:
    Jan 4, 2017
    Posts:
    16
    Yep. obviously and brain farting today.

    Actually my problem is not that, but rather how to trigger my Firing function at any time, and not just based on an event called from specific objects.

    I tried applying an onPointerDown event trigger to my reticle (since you are always looking at that).... but no luck. I'm testing it in my cardboard via unity remote (does that make a difference?). ive also tried PointerClick

    Thanks a bunch
     
  30. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
  31. moodiey

    moodiey

    Joined:
    Jan 4, 2017
    Posts:
    16
    Unity remote can register some basic interactions for testing but full intergration isnt there quite yet.

    Thanks Selzier!
     
  32. AM-Dev

    AM-Dev

    Joined:
    Aug 5, 2015
    Posts:
    31
    Hey @Tunkali, Hey @Selzier,
    I'm looking for the same option. The buttons are not clickable for me at the moment. How can I implement a fullscreen canvas on top with a custom "Main Menu" button in a corner?
    Thanks

    EDIT: I abandoned the idea with a fullscreen canvas overlay. I found a solution here. However it doesn't work (using GVR 1.30) for me in the LateUpdate, therefore I've moved it into the update.
    Code (CSharp):
    1. void Update () {
    2.             gvrViewer.UpdateState();
    3.             if (gvrViewer.BackButtonPressed) {
    4.                 // Go back to UI Scene
    5.                 SceneManager.LoadScene("UI");
    6.             }
    7.         }
     
    Last edited: Mar 20, 2017
  33. suhashendole

    suhashendole

    Joined:
    Apr 3, 2017
    Posts:
    1
    Selzier,

    Thanks for your video, that is helpful to understand the concepts more precisely.
    I am newbie in VR development, and i am trying to add a cursor in a 360 video(as user selects dot, it should show like and dislike option), but i am unable to find a solution to how to do it in a video, if you can give me some inputs or references, that will be helpful.
    Thanks a Ton!
     
  34. ab_salazar

    ab_salazar

    Joined:
    Aug 23, 2016
    Posts:
    7
    Hello Selzier, any chance you could share the fix with me? Thanks!
     
  35. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
  36. P1505C

    P1505C

    Joined:
    Oct 12, 2017
    Posts:
    14
    Is there a way to increase the distance of the raycast, so that I can trigger items much further away?
     
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    in GvrReticlePointer.cs script, default is 10,
    public const float RETICLE_DISTANCE_MAX = 10;
     
  38. P1505C

    P1505C

    Joined:
    Oct 12, 2017
    Posts:
    14
    Thanks. Not sure how but it's now not working at all. :) Doesnt trigger any events, not sure what I did. A night of bug fixing is in order I fear.
     
  39. P1505C

    P1505C

    Joined:
    Oct 12, 2017
    Posts:
    14
    Back working, but changing that float does nothing to increase the distance the raycast works too. At least it's not for me. I'll keep playing.
     
  40. P1505C

    P1505C

    Joined:
    Oct 12, 2017
    Posts:
    14
    Ignore me, Visual Studio was at fault. It had requested firewall access and wasn't saving files until granted.
     
  41. Nandagopal92

    Nandagopal92

    Joined:
    Feb 1, 2018
    Posts:
    1
    The event is triggered when the reticle is pointed and clicked on the object, using the mouse pointer, in Unity. But the same is not happening when i click the magnetic button on the VR. Please do help.
     
  42. wiktorG

    wiktorG

    Joined:
    Mar 6, 2018
    Posts:
    1
    Hi! I have a problem, that when the pointer enters any sprite, then the pointer disappears. Like the sprite is covering it. I've checked sorting layers, but everything seems to be okay with that. Can you help?
     
  43. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Did you add a collider to the sprite?
     
  44. afnanRed1

    afnanRed1

    Joined:
    Feb 11, 2018
    Posts:
    2
    I'm using sdk ver 0.6, the reticle works just fine in the editor but whenever i build the game into an android device it doesn't work anymore. it's supposed to collect stuff but it's so not accurate, do you have any ideas to solve my issue?

    thanks in advance.
     
  45. afnanRed1

    afnanRed1

    Joined:
    Feb 11, 2018
    Posts:
    2
    yeah, also i had some issues building the game at first where only the background color was shown in the android device without any objects. I solved it by setting the VR mode enabled in the cardboard script to false and used the virtual reality supported in the player settings instead. do you think this has anything to do with my reticle problem?
     
  46. antbaumann

    antbaumann

    Joined:
    Apr 23, 2018
    Posts:
    2
    Hello Selzier, I'm working on my thesis and your videos are giding me all the way through, but now I would really appreciate some help. I was able to implement the gaze pointer really well using event triggers for my tool. Now I'm trying to implement a menu with a couple of settings for the tool, (I followed your tutorial with the TV menu) But i cant get the gaze pointer to recognize the Button objects (the reticle does not expand when I look at the buttons, the onClick functions dont work and the colors don't change to highlighted). Any advice on how i could fix this?

    Ive tried making sure all canvas components are there (Canvas, Canvas Scaler, Graphic Raycaster) But don't know what else I can do. I have
     
  47. alienkani

    alienkani

    Joined:
    Nov 15, 2017
    Posts:
    3
    Hay Selzier,
    I Need your help I Have a Nibiru VR Headset and I built an application for Android Device when i play the application a retriclepoint Genrate,it's On trigger and Onexit event works fine but when i click on Gameobject It doesn't work but when i set Mouse Enable setting in My VR headset it works fine but after that two Pointer Are enabled One is My Headset Cursser and second is my Application Reticle Pointer. please help me.
     
  48. PSingh96

    PSingh96

    Joined:
    Apr 12, 2017
    Posts:
    3
    Hi guys, I was working on some VR projects and i'm stuck with an issue, if anyone has worked on or can figure it out then it would be really helpfull.

    I wanted to build a VR project for WebGL platform and i'm using https://assetstore.unity.com/packages/templates/systems/webvr-assets-109152

    But I want a simple Gaze interaction without any controllers to interact with the environment.
    Please help me out!