Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Use GearVrController with Selection Ray - Unity

2»

Comments

  • JBivBeatsJBivBeats Posts: 12
    NerveGear
    @oculus_gabor this works perfectly for me in the demo, but when I add the scripts needed I get the following errors in the raypointer script:

    assets/drive in assets/RayPointer.cs(36,25): error CS1061: Type `UnityEngine.EventSystems.OVRInputModule' does not contain a definition for `OnSelectionRayHit' and no extension method `OnSelectionRayHit' of type `UnityEngine.EventSystems.OVRInputModule' could be found. Are you missing an assembly reference?


    Assets/drive in assets/RayPointer.cs(61,25): error CS1061: Type `UnityEngine.EventSystems.OVRInputModule' does not contain a definition for `OnSelectionRayHit' and no extension method `OnSelectionRayHit' of type `UnityEngine.EventSystems.OVRInputModule' could be found. Are you missing an assembly reference?

    Assets/drive in assets/RayPointer.cs(107,25): error CS1061: Type `UnityEngine.EventSystems.OVRInputModule' does not contain a definition for `activeController' and no extension method `activeController' of type `UnityEngine.EventSystems.OVRInputModule' could be found. Are you missing an assembly reference?


    Assets/drive in assets/RayPointer.cs(132,29): error CS1061: Type `UnityEngine.EventSystems.OVRInputModule' does not contain a definition for `SelectionRay' and no extension method `SelectionRay' of type `UnityEngine.EventSystems.OVRInputModule' could be found. Are you missing an assembly reference?

    Assets/drive in assets/RayPointer.cs(133,36): error CS1061: Type `UnityEngine.EventSystems.OVRInputModule' does not contain a definition for `SelectionRay' and no extension method `SelectionRay' of type `UnityEngine.EventSystems.OVRInputModule' could be found. Are you missing an assembly reference?


    am I missing something?  I'm sure it's something simple that I may have missed, could you please take a look?

  • oculus_gaboroculus_gabor Posts: 40 Oculus Staff
    Hi @JBivBeats

    You are not missing something, you have multiples of something :p

    When i originally wrote that blog, UI interaction scripts were not being shipped with Oculus Utilities for Unit. I think right around the 1.20 or 1.21 release, those scripts started getting included with the utils. The blog post uses a custom version of these scripts. I have the custom versions namespaced in a way that they can co-exist with the version in utils.

    For example, searching for OVRRaycaster will result in 2 files



    Make sure to use the version if these scripts you are using is from the OVRInputSystem



    I'm going to be working on rolling my version of these scripts into the utilities, to avoid this issue; but i'm not sure how long that's going to take or what the ETA is.

    ~Gabor
  • mallmagicianmallmagician Posts: 297 Oculus Start Member
    Thanks very much everyone for the perseverance with this. This will be very useful to me as I make the switch from game pad to oculus controller in my current project. 
  • alexvilchalexvilch Posts: 38
    Brain Burst
    Could you point out how to attach the ray to Oculus Rift touch controller ? Right or left hand for example from Avatar SDK example ? I've tried to add VRRaycaster to right hand but just see only some blinking.

    Thank you,

    Alex
  • mbrklmbrkl Posts: 1
    NerveGear
    I would also appreciate to have an equivalent sample code of a laser pointer for object selection for the Oculus Touch Controllers
  • ClydeHuibregtseClydeHuibregtse Posts: 1
    NerveGear
    edited June 2018

    Hey! I love the tutorial, and I am very close to replicating this with my own project. However, my current issue is that these rays are only hitting Non-UI elements. I can extract information from 3D objects the rays hit, but they seem to pass right through UI elements with no return. If this is a common issue please let me know what your thoughts are. I have scoured a ton of details looking for any asymmetries between our two projects and cant seem to find one.

    Let me know.
  • oculus_gaboroculus_gabor Posts: 40 Oculus Staff
    @ClydeHuibregtse Hitting the UI is going to have to go trough a different system than hitting 3D objects (IE, not Physics.Raycast). The code presented in this post will do both: https://developer.oculus.com/blog/easy-controller-selection/

    Hope that helps, let me know if it doesn't.
  • hamxa.ahmad.39hamxa.ahmad.39 Posts: 1
    NerveGear
    I appreciate the Oculus staff helping out this much, but it'd b great if Oculus could proivde the relevant scripts with the Oculus integration asset provided in the asset store. I spent a week roaming here and there for answers, before I stumbled. The scripts provided here work like   a charm
  • OrangeCakeStudioOrangeCakeStudio Posts: 1
    NerveGear
    edited September 2018
    Hi, the link to the 3 rar files is broken..it says the files are corrupt?
    EDIT: Ignor this..I just needed to extract all 3 rar files at once :)
  • riftarriftar Posts: 2
    NerveGear
    how can i show pointer from remote avatar? since it doesn't have tracking space. I want to use this pointer on a multiplayer scene
  • Bvis2017Bvis2017 Posts: 1
    NerveGear
    I know this thread is a little old but it is still very useful! I have one question...

    In the example, you have one "OnHoverEnter" function. What if I have multiple spots of interest and when I hover on them I want them all to have separate functions? Right now, if even if I write separate functions they all activate. 

    For example - Sphere onHoverEnter - turn blue, Cube onHoverEnter - turn yellow (or anything else)

    Thank you for putting this great resource together!
  • Sreee47Sreee47 Posts: 1
    NerveGear
    HI,

    I am trying to develop with the latest version of the oculus integration i.e 1.37. But by following the tutorials given here I am not able to reach the goal. I wanted to implement a laser and a reticle and then interact with 3d and ui elements using the latest version of sdk i.e 1.37. Can any one help me out with some documentation or steps for the same.

    Thanks
Sign In or Register to comment.