playMaker

Author Topic: Oculus Go and Gear VR Controller Actions  (Read 927 times)

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #15 on: January 04, 2019, 06:54:33 AM »
Hi edufurla, I've written the custom action for you and it should work right out the box. I have not been able to test it as yet, but will do so in a few hours as I am currently out for the day.

Give it a test and let me know if any issues, here is the link: https://raw.githubusercontent.com/HendrikZA/general-playmaker/master/oculus%20go%20and%20gear%20vr/OculusVRInputSource.cs

It should appear in the Input category in your Action Browser, once you've added the script to your project.

edufurla

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #16 on: January 04, 2019, 08:45:48 AM »
Awesome! :D :D
Thank you. I will wait for your post.
Thank you

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #17 on: January 04, 2019, 11:52:40 AM »
Hey edufurla,

Yup it all works I just tested it :) The action can detect if controller is left or right, and also if no controllers are detected, it shows that HMD only is true, so one can assume it is a Gear VR without controllers for example.

Give it a go and hopefully Oculus will accept your published game, I wish you best of luck with your submission to Oculus :)

edufurla

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #18 on: January 06, 2019, 02:31:31 AM »
Hi Hendrik.

It worked perfectly. :) :)
Thank you.

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #19 on: January 06, 2019, 03:57:19 PM »
Hi Hendrik.

It worked perfectly. :) :)
Thank you.

Nice dude :)

WayneAdams

  • Playmaker Newbie
  • *
  • Posts: 17
    • View Profile
    • Glacier Studios
Re: Oculus Go and Gear VR Controller Actions
« Reply #20 on: January 09, 2019, 03:06:19 PM »
Awesome to see you working on this. Thanks so much!

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #21 on: January 09, 2019, 05:02:18 PM »
Awesome to see you working on this. Thanks so much!

It's a pleasure Wayne :) I'm using these actions I created in my own projects I'm working on and they have made life much easier!

If I find any new or interesting things I can make actions for Gear VR / Oculus Go, I'll add those too. I'll build some actions as well for Oculus Quest closer to its launch. I think those use the standard Rift touch controller inputs so they should be relatively easy to make.

edufurla

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #22 on: January 11, 2019, 08:42:11 AM »
Hi Hendrik.
Is it possible to make an action getting the sensor info from the Oculus Go or Gear VR? To know when someone removed the headset.
Thank you

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #23 on: January 11, 2019, 11:59:49 AM »
Hi Hendrik.
Is it possible to make an action getting the sensor info from the Oculus Go or Gear VR? To know when someone removed the headset.
Thank you

Hey edufurla,

Sure no problem, I'll write this now and add to Github. Will let you know when it is available. Will make it so that:

Send event if headset removed
Send event if headset is back on user face
Store bool - true if headset removed

So you will be able to use the events, or just store the bool to use for your own FSMs.

Will have it available in next hour :)

Cheers,
Hendrik

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #24 on: January 11, 2019, 12:53:17 PM »
Ok I've added an action for Gear VR and Oculus Go to check if the headset has been removed and when it is put back on.

Here is the action:

https://raw.githubusercontent.com/HendrikZA/general-playmaker/master/oculus%20go%20and%20gear%20vr/GetHeadsetStatus.cs

I'll test it some time this weekend but it should work just fine :)

Cheers!
Hendrik

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #25 on: January 11, 2019, 01:08:04 PM »
Ok I've added an action for Gear VR and Oculus Go to check if the headset has been removed and when it is put back on.

Here is the action:

https://raw.githubusercontent.com/HendrikZA/general-playmaker/master/oculus%20go%20and%20gear%20vr/GetHeadsetStatus.cs

I'll test it some time this weekend but it should work just fine :)

Cheers!
Hendrik

Hmm seems it has a compiler error in Unity. I'll investigate, test and re-upload. Will let you know :)

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #26 on: January 12, 2019, 05:12:03 AM »
Hi edufurla, I'm working on this and testing it today. Encountering some small issues with this particular one, but it will be ready soon.

Also, I'm going to break down the larger GetVRButtonDown.cs action into smaller pieces. The larger one will still be available for folks who prefer the larger action with everything on it, but I also understand that it takes up a lot of space in the Action Browser when "Preview" is enabled. So I'll have for example button presses in a separate action and the capacitive touch in a separate action just to begin with, which will make it much shorter.

I'm also experimenting with a controller rotation and positioning action, which although might not be that useful since most Gameobjects can just be parented to the right/left hand on the OVRCamera, it might still prove useful in some situations depending on your needs. Good to have it rather than not.

Will update later today or at the very latest tomorrow with this Headset off / on face action.

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #27 on: January 13, 2019, 11:46:10 AM »
Ok here is a new action to check if the Headset is on or off the face. You can send an event, or simply store the bool value to use for your own purposes :)

https://raw.githubusercontent.com/HendrikZA/general-playmaker/master/oculus%20go%20and%20gear%20vr/GetHeadsetStatus.cs
« Last Edit: January 13, 2019, 12:41:11 PM by HendrikB »

HendrikB

  • Playmaker Newbie
  • *
  • Posts: 32
  • In love with Playmaker
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #28 on: January 13, 2019, 12:40:04 PM »
I've also added a small action that just gets the controller rotation and position on every update. You can play around with it to see if it can be useful for you. I would imagine that you can use it to do stuff like door handle turning, controlling guns in the scene, etc.

I have played with it a bit and it works well. I'd recommend using debug or setting a text value every frame with the rotation and/or position of the controller to see how the rotations change to see which angles would indicate pointing left, right, up, down etc.

https://raw.githubusercontent.com/HendrikZA/general-playmaker/master/oculus%20go%20and%20gear%20vr/GetVRControllerRotation.cs

I was thinking to use it for a reload action, when player pulls remote up towards their body, pointing upward. But there's an easier way to do that. You just add a cube above the player's head, mesh turned off, and collider set to trigger. Then if you are using a raycast with a controller's laser pointer, you can check if it hit the cube above the head, and hook up a global event to that in an FSM. I just did that a little while ago and was able to trigger a reload event each time without any issues when the controller was pulled up towards the head.

Anyways, happy developing folks :)

edufurla

  • Playmaker Newbie
  • *
  • Posts: 38
    • View Profile
Re: Oculus Go and Gear VR Controller Actions
« Reply #29 on: January 14, 2019, 05:49:46 AM »
Hi Hendrik, - that was fast! :D
Thank you very much.
I will give a try with the new rotation action too. I have no projects to use it right now but can be very handy in the future.