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

Easy Input for Gear VR and Oculus Go [Released]

Discussion in 'Assets and Asset Store' started by greggtwep16, May 2, 2017.

  1. cbvr

    cbvr

    Joined:
    Nov 25, 2018
    Posts:
    6
    Unity 2017.4.3f1

    Thanks.
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I downloaded this version and did not have the issue shown in the video. I also downloaded latest Unity with the same results. Basically, new project, imported Easy Input, clicked ignore all since we are testing in editor, and ran the pointer scene and did the movements shown. No weird floating like shown in your video.

    Is there something different that you did? Also, what framerate are you getting?
     
  3. cbvr

    cbvr

    Joined:
    Nov 25, 2018
    Posts:
    6
    Yes, that's exactly what I did. I just made the project again from scratch, exactly as you described above, and the lag is the same - framerate holding steady at 75-80 fps. And to be ultra clear, the animation is a simple transform animation (looping) through the Animator component, which is applied to the Capsule. Frustrating.
     
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Oh so it's not just the plain example (I assume that's fine). You mind sending my support email address the modified scene? That way I can take a look.
     
  5. cbvr

    cbvr

    Joined:
    Nov 25, 2018
    Posts:
    6
    Sent. Thanks.
     
  6. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I took a look at this and you are seeing the lag because the animator update mode isn't using update physics. If you flip it to that the lag will go away.

    I'm using the physics raycasting to determine the start and end positions based on what the laser pointer hits, so it needs to sync it's work to the Unity physics simulation.
     
  7. kgk543

    kgk543

    Joined:
    Dec 7, 2018
    Posts:
    1
    How to restrict the StandardLookDpadController to the particular area or particular Game Object like Floor of the room
    Please help me
     
  8. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Generally speaking for a room you place a collider on the walls of your room and a collider and rigidbody on your character. That way when you run into the walls you can't go through. Generally for the character you use a capsule collider so you can go up/down things like terrains or stairs.
     
  9. sapizon

    sapizon

    Joined:
    Dec 7, 2018
    Posts:
    10
    Hello, I'm trying to implement a sphear changing technique for 360 Images does this asset work for my requirement?
     
  10. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    It really depends as there are many ways to do 360 photos/videos. If you mean a complete set of scripts where you wouldn't need to code anything, then no not for that usecase. If you are using one of the other plugins that does the playback and all you need is some interactions with UGUI buttons, then yes the product does handle the UGUI interaction. You'd still need to wire that up to swapping out the spheres though.
     
  11. FranknSon

    FranknSon

    Joined:
    May 27, 2017
    Posts:
    19
    ok - Thanks
     
  12. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
    I have just made a test build of the demo scenes for gear vr and I am having some problem with the back and home buttons.
    The problem is the back or home buttons, when in child scenes, move me out of the game, instead of the master scene.
    When I was previously testing it on OculusGo everything worked fine.
     
  13. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The home button is reserved by Oculus so nothing to do there. The back button short press is controllable (long press is reserved). When in a child scene are you using exit to master or your own script?
     
  14. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
    The original exit to master script was not working for for me until I have commented everything and put this:

    Code (CSharp):
    1.         private void Update()
    2.         {
    3.             if (OVRInput.GetDown(OVRInput.Button.Back) || OVRInput.GetDown(OVRInput.Button.Two) || Input.GetKey(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Escape))
    4.             {
    5.                 SceneManager.LoadScene("MasterExample");
    6.             }
    7.  
    8.         }
    and now one of these buttons (the left one) is working.
    I found this code somewhere on some forum.
     
  15. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The left one is the back button. The code you posted is essentially the same. I went back and checked and exit to master works on my go and gear vr, strange that it doesn't for you but if it's working for you now, probably not worth messing with it.

    In any case glad you got it sorted.
     
    tomekkie2 likes this.
  16. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Hey Gregg, we are implementing Oculus GO, Vive Pro, and Rift into our VR/AR program and I am putting together the curriculum, which includes tools and course materials. I am testing every solution that I can find to work with for my students, and have, among others, downloaded Easy Input for Gear VR Oculus Go. I am having some trouble getting things going and was wondering where I am going wrong. I've tested the laser pointer switching scene, and it seems to work perfectly, but when I try to replicate the results in my own scene, I believe I'm doing something wrong in the setup.

    Essentially, I have 3 standard UI buttons in a canvas, and want to use a laser pointer and trigger to select the button and initiate toggling on/off 1 of 3 models in my scene. Not too far off of what you do in the example scene... just don't actually know what part is wrong. Is there a video on this type of basic setup for Go someplace?

    Thank you,
    Mike
     
  17. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Do the buttons click and then it doesn't activate/deactivate or is it that the buttons don't click in the first place? I'm going to assume the second currently, make sure you have all of the below.

    1. Easy Input module is on your UI and Easy Input Helper in your scene.
    2. That input module is populated in the pointer's inspector and UI raycast checked.
    3. The pointer's distance is longer than the distance in which you are trying to click at (you set this distance and everything beyond that is ignored).
     
  18. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    I have re-setup everything according to your instructions above. The buttons are not showing any signs they are receiving the clicks. Do the button items need the Custom Touch or Click script added to each one, or can I set them up like I would a normal UI Button, i.e. add an object with the script attached and call the method within the script.

    Thank you
     
  19. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73

    Quick question,
    For number 1 above, is UI referring to the overall Canvas or each button?
     
  20. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Do you have the teleport receiver on your meshes for the sci fi scene along with a mesh collider? Generally speaking that's all that is needed and you shouldn't have to put invisible planes in front of the meshes. If you do this the green outlines in the scene view will be the colliders that you can teleport to.

    The reticle can be anything so if you prefer a circle you can certainly do so. It's just another gameobject so if you wanted to project something off of it you can certainly add components to do so.
     
  21. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    No nothing special on the buttons.

    The canvas not each button.

    One of the other things to check is that your GUI is not screenspace and that it's oriented the right way. By default Unity ignores raycasts to the backside of the GUI you can uncheck that option and try again.

    If either of those don't work can you zip up your project and send it to my support email address. I can certainly take a look.
     
  22. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
    1. How to get the HMD angular velocity on Gear VR?

    2. I have looked at Gear VR diagnostics example scene and have also some questions regarding HMD acceleration values there. When trying to stay still:
    HMD Accel X shows me values around - 0.03; (sensitive to right-left turn)
    HMD Accel Y shows me values around - 0.99; (sensitive to up-down turn)
    HMD Accel Z shows me values around - 0.05; (sensitive to turning around forward axis)

    What these values mean? I expected some +- noise, while these values are like HMD was continously accelerating.
    Why HMD Accel Y could be that much higher than others?
     
  23. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The Oculus SDK doesn't have a call for the HMD for those. It does have one for controller but for some reason not the HMD. What you see in my example scene for Gear VR is using the phone's info not the HMD's (The go doesn't have a second set of sensors so those values are 0 on the go). The best you can do to get those values is to save currentdata and lastframe data and then you can derive what the value is.

    As far as your question on the Accelerometer what you see is correct. Accelerometers unlike gyro's don't filter out gravity so that's why you see it's value near -1g and the other's near 0. If you rotated the HMD you'll see the axis reporting 1 will change.
     
    tomekkie2 likes this.
  24. eovento

    eovento

    Joined:
    Feb 22, 2018
    Posts:
    38
    Hello, Greg!

    I wrote you a few times throughout almost one year and you were always willing to help, which is great. And every time you say it's going to be an update, or that something will be fixed, or improved... but the thing is it's been one year and you have never updated your asset. And all my requests or ideas or insights were left aside. (As everybody else's.)

    You constantly say it needs time as you would need to update documentation as well.
    Docs are always great, but... if this is the thing holding you back, please leave documentation for later as for must devs I believe functionalities would be more urgent.

    You might have realised, in comparison to the majority of nowadays games on Oculus Store, that the movement controls your asset provides are absolutely outdated and far from being something good and comfortable. I would adore to have more options on this... in example, to walk in relation to controller pointing direction, and not where I am looking at. And to walk any direction in relation to that (ahead, backwards, left, right - and not only ahead).

    There were many other things I suggested/requested before that you promptly said you would do and never did... most of them don't matter anymore as I came out with my own solutions. But this moving functionality I believe is one of the most important - if not the most important - thing on your asset and would greatly benefit pretty much everyone of your buyers.

    Please consider improvements... 1 year without updates on an asset of this nature is really too much... it's not a 3D model of a toaster, it is something that is ever and gradually changing/improving within time.

    Thanks!
     
    tomekkie2 likes this.
  25. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    I agree with your sentiment, after the popup unity menu submission rejection changing how that works has been the main priority. Rather than promise another date that might be missed all I can say is that I'm still working on this asset and doing the best I can.
     
    tomekkie2 likes this.
  26. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Hi. How would one go about making a grabbable switch? Is it possible with this asset? Thanks!
     
  27. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Since there are a lot of switch types can you let me know in detail what you had in mind. Depending on which type some of the ways to achive this are as follows.

    1. If it's a typical light switch which both switches up and down and rotates, the easiest way is to do it in an animation. Put a box collider around the whole switch and use the customPointerClickReceiver to play the animation.

    2. If it's a sliding switch and you really want the grab mechainic with the laser pointer. Then you can use the grab reciever and then lock say x axis and z axis so that the switch can only go up and down.
     
    LaCorbiere likes this.
  28. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Thank you. I did have to go back to a totally blank scene, and rebuild everything carefully. I believe I did everything this same as before, however, it is all now working. I will keep everyone posted!
     
  29. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Yes I think animation is the way to go. Seen a lot of collision based swtiches out there with a lot of hit and miss results. Thanks for the response.
     
  30. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    Hi. I'm getting a lot of glitching when I pick something up. Anyone come across this before?

    Can't post a video as Oculus have changed the codec for the video recording feature and can't view on PC. Best way to describe it is that the grabbable object is jumping wildly around in the vertical space,
     
  31. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    I've had something similar happen, but it seems be more of a jump to the center of the ray.
     
    LaCorbiere likes this.
  32. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Can't say I've had this. Are you hitting any colliders with the grabbed object?
     
    LaCorbiere likes this.
  33. LaCorbiere

    LaCorbiere

    Joined:
    Nov 11, 2018
    Posts:
    29
    LOL had a rigidbody on the laser pointer! All good now :)
     
    Spookytooth3D likes this.
  34. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Hey Greg, I'm posting my project file on Google Drive, and I'll send you and email with the details. For some reason, my Canvas buttons are not working again, and I can't figure out what the perfect recipe is for configuration. I know it has got to be something simple, as all of your test scenes work great. However, it doesn't like something I'm doing, and if you don't mind taking a look, I would appreciate it. I'll add a readme.txt to the file as well. Thanks!
     
  35. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    The files are up and an email has been sent. Cheers.
     
    greggtwep16 likes this.
  36. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    Hi, I need a simple teleporter added to my scene for the oculus go, does this asset have it? If so is it easy to add and setup?
     
  37. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Yes there is a teleport system included (and an example that shows it). Basically for teleporting you need the following.

    1. The pointer type you want to use (curved laser, gaze, etc.). You also set the range of the laser here.
    2. One or more objects with a teleport receiver on it. In simple cases this is usually just the ground or in some games you only want to move to predetermined points which in that case you'd put the receiver only on those objects.
     
    AJS654321 likes this.
  38. AJS654321

    AJS654321

    Joined:
    Oct 11, 2018
    Posts:
    57
    what version of unity does this work best with please? thanks
     
  39. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Any recent version of unity and Oculus utilities.
     
  40. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Hi. While I have found a way to get my controller and Canvas happy with one another, I was hoping to implement the following code as well. The idea is simply to grab the name of the object the point is over, and put it into the value of a Canvas text object.

    Here's what I have so far

    Code (CSharp):
    1.     public void hitMe(){
    2.  
    3.         RaycastHit hit;
    4.         if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity, 10))
    5.         {
    6.             myLabel.text = myObject.name;
    7.         }
    8.         else
    9.         {
    10.             myLabel.text = " ";
    11.         }
    12.     }
    Thanks,
    Mike
     
  41. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Screen Shot 2019-02-11 at 3.17.31 PM.png
     
  42. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    While you could probably write some extra code to do it that way, I think just directly querying the gameobject is much simpler. If you are doing this for a 3d object simply have the function that's called reference it's own name. If you are doing this with uGUI just query the event system's current selected gameobject's name.
     
  43. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    :) I thought I was with the code above. What I'm unsure of, is what to do in order to read the name of the object I am hovering over using the Standard Pointer Receiver script.

    I've tried using collision detection without success.... the only script that is getting close might be this...

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class activeObject : MonoBehaviour
    7. {
    8.  
    9.     public Text myLabel;
    10.     public GameObject myObject;
    11.     public string myObjectName;
    12.  
    13.  
    14.     public void hitMe()
    15.     {
    16.         myObjectName = myObject.name;
    17.         myLabel.text = myObjectName;
    18.     }
    19. }
    20.  
    21.  
    22.  
    The main issue here is it doesn't grab the name of the GameObject, and I would have to assign this to all of the components, and each of their associated GameObjects to the script...

    I just want to know the name of the GameObject the laser is pointing at / Hovering over...
     
  44. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    I'm using a Canvas (World Space) attached to the laser pointer object for a graphical user interface. I want to set the value of the text label "ObjectName" with the name of the object the laser is pointing at... simple right?

    Screen Shot 2019-02-12 at 1.23.37 PM.png
     
  45. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Ok, so with interesting results, this solution seems to be closer to the right approach...

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class activeObject : MonoBehaviour
    7. {
    8.  
    9.     public Text myLabel;
    10.     public string myObjectName;
    11.     public bool hasHit;
    12.     public bool noHit;
    13.  
    14.  
    15.     void Start(){
    16.         myObjectName = this.gameObject.name;
    17.     }
    18.  
    19.     void Update(){
    20.  
    21.         if(hasHit)
    22.         {
    23.             myLabel.text = myObjectName;
    24.         }
    25.  
    26.         if(noHit)
    27.         {
    28.             myLabel.text = " ";
    29.         }
    30.  
    31.     }
    32.  
    33.     public void hitMe()
    34.     {
    35.         //myObjectName = this.gameObject.name;
    36.         hasHit = true;
    37.         noHit = false;
    38.         myLabel.text = myObjectName;
    39.  
    40.     }
    41.  
    42.     public void hitMeDone()
    43.     {
    44.         hasHit = false;
    45.         noHit = true;
    46.         myLabel.text = "";
    47.  
    48.     }
    49. }
    50.  
    51.  
    52.  
    Th issue with the code above is that each of the items I want to show up in the table have to have the script attached along with the StandardPointerReceiver... Interestingly enough, if I point at the objects in a particular order, eventually, only 1 of the 3 items with the script attached will activate the label name.

    I have a hunch it has something to do with a sorting order of some kind. Will post additional results here as I solve this.
     
  46. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    The receivers (pointerClickReceiver, grabReceiver, etc.) are on the objects that are getting hit not the laser pointer itself. So all you have to do is reference "this.gameobject.name" inside of the receiver if hitme is on the same object.

    If you are saying you'll have 200 things and you want a centrally located place to do it it would make sense to modify the pointer you are using and do it there. lastHitGameObject is what you want to reference it will either be populated or will be null if hitting nothing.

    This is for objects with colliders on them using physics. For GUI items you don't need to do any of that and simply reference the eventsystem's selected gameobject.
     
  47. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Yes as mentioned if you are doing it for a gui and not 3d objects simply reference the eventSystems's selected game object via "EventSystem.current.currentSelectedGameObject". This doesn't only apply to my product this for any Unity GUI at any time.
     
  48. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    I'm only changing the value of the text in a Canvas Text object to the name of the object being pointed at.
     
  49. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Correct, which would be the currently selected object in the event system.
     
  50. Spookytooth3D

    Spookytooth3D

    Joined:
    Oct 31, 2013
    Posts:
    73
    Greg, Thanks for the tips... This is working as expected. I am thinking that by simply adding the Event System to the mix, fixed the issue. Here's the code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using UnityEngine.EventSystems;
    6.  
    7. public class activeObject : MonoBehaviour
    8. {
    9.  
    10.     public Text myLabel;
    11.     public string myObjectName;
    12.  
    13.     EventSystem m_EventSystem;
    14.  
    15.     void Start(){
    16.         myObjectName = this.gameObject.name;
    17.         m_EventSystem = EventSystem.current;
    18.     }
    19.  
    20.  
    21.     public void hitMe()
    22.     {
    23.         myLabel.text = "" + myObjectName;
    24.     }
    25.  
    26.     public void hitMeDone()
    27.     {
    28.         myLabel.text = "";
    29.     }
    30. }
    31.  
    32.  
    33.