cancel
Showing results for 
Search instead for 
Did you mean: 

New to coding, new to oculus go, ovrrig not attaching controller?

odi0n
Honored Guest
Hello,

New to coding, sort of getting an understanding of Unity, from a month old understanding.


My issue.
I am having extreme issues connecting the Oculus Go controller to the OVR camera, in Unity. Seems simple enough, In hierarchy, attach controller model and required OVR scripts to OVRrig, in one of the anchored hands.  

I do this, and unfortunately, as soon I jump into VR, the controller is missing, I can’t even move. I’m getting met with resistance, for the very basics.

I’ve been to these:
https://developer.oculus.com/blog/everything-you-need-to-know-to-develop-for-oculus-go/

https://developer.oculus.com/reference/unity/1.27/

https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/

https://developer.oculus.com/reference/unity/1.27/class_o_v_r_camera_rig/

1) None of that makes sense to me (I am *very* new) those articles were definitely not written with my kind in mind. No Quick 2-3 min tutorial videos or walkthrough guides for the very basics huh? Just here - take an encyclopedia to the face.

2) Spent 6 hours searching most of that stuff, I started at 12:30am, here we are at 6:30am. In the end, I feel I wasted all that time, I learned absolutely nothing, and still didn’t find anything remotely close to figuring out my issue, on how to connect the remote to ovrrig camera. 

Lastly, why would oculus add unnecessary difficulty? (no way to use headset to see real-time feed?) we’re forced to build everytime to run test? (Why would they do that?) all of the other mobile headsets, from what I’ve seen in YouTube, offer real-time direct feed from headset onto pc. Daydream, Gear VR.. etc.  
5 REPLIES 5

Halfspacer
Adventurer
Hi Odi0n,

1) Check out this Medium article on Building Your First App For The Oculus Go
https://medium.com/inborn-experience/how-to-build-an-app-for-the-oculus-go-from-start-to-finish-with...

2) If you don't learn anything within the first hour of researching, it's not worth spending another five. Time for a new study approach! 

To answer your final question, 
I believe a real-time editor preview solution is being looked into, but essentially what it is is your computer running the app and then streaming the image to your device - This comes with a bunch of potential issues (latency, compression, controller pairing etc). 
Building and pushing your APK to your device is a much better way to preview the app and get a feel for how it's running.

And lastly I'd recommend this subreddit, 
https://www.reddit.com/r/UnityforOculusGo/

If you scroll down (I don't know why the posts aren't pinned), you can find a lot of good resources for getting started with Go development in Unity. 

odi0n
Honored Guest
Thank you @Tolin93

New approach indeed. 

Unfortunately, the medium article doesn’t help, all I get is very skewed, warped looking scene.

Though, 
after peering further yesterday, I noticed, that when making the GO controller model a child of the player capsule - you don’t see the controller, because (it’s inside your character Model) at opposite end of where your camera is facing. 

once I figured that out, I moved it into the view of camera. Now I see it, it follows my hand correctly, the issue now is getting the controller adjusted to the correct height.

Also, my environment of just a floor and and walls created from unity cubes. Are super jaggy and not sharp.

I figured had to do with Fixed Foveated. I went ahead and created a FixedFovested Script, from here:
https://developer.oculus.com/documentation/unreal/latest/concepts/unreal-blueprints-get-tiled-multir...

I then attached the script to the character Model:
ETiledMultiResLevel_LMSHigh (index = 3): 

still have a extremely jaggy looking environment. FFR was not the resolve. Tge goal today is to attach the 72hz code and find the anti aliasing code and use that if needed. But I have an extreme jagged surrounding, to the point it’s stabbing my eyes. 

@Tolin93 thanks again! I appreciate any help as this stuff is super complex for as 1st month person like myself. 

Halfspacer
Adventurer

odi0n said:
once I figured that out, I moved it into the view of camera. Now I see it, it follows my hand correctly, the issue now is getting the controller adjusted to the correct height.
@@odi0n
If you've imported the Oculus Utilities package into Unity, you can go to Assets/Oculus/VR/Prefabs and drag the OVRPlayerController into your scene. It has ready child objects called "RightHandAnchor" and "LeftHandAnchor" that are correctly positioned. You can then just drag the Tracked Remote prefab into these and make sure their transform (position) is at 0,0,0.



odi0n said:
Also, my environment of just a floor and and walls created from unity cubes. Are super jaggy and not sharp.

Are you using Legacy or the newer Lightweight Render Pipeline? Antialiasing (MSAA) is not yet supported on LWRP as far as I know. If you're on Legacy (if you haven't specifically set Unity up for LWRP then you most likely are), simply go Edit-> Project Settings -> Quality and set Anti Aliasing to 4x MSAA.
Also make sure any textures you import have Generate Mip Maps ticked in the Texture Import Inspector.



odi0n said:
I figured had to do with Fixed Foveated. I went ahead and created a FixedFovested Script, from here:
https://developer.oculus.com/documentation/unreal/latest/concepts/unreal-blueprints-get-tiled-multir...

I then attached the script to the character Model:
ETiledMultiResLevel_LMSHigh (index = 3): 

still have a extremely jaggy looking environment. FFR was not the resolve. Tge goal today is to attach the 72hz code and find the anti aliasing code and use that if needed. But I have an extreme jagged surrounding, to the point it’s stabbing my eyes. 

@Tolin93 thanks again! I appreciate any help as this stuff is super complex for as 1st month person like myself. 



The code you have right there is for Unreal Engine (Not Unity). If you want high FFR and 72hz, add this bit of code to any Start() method.

        OVRManager.tiledMultiResLevel = OVRManager.TiledMultiResLevel.LMSHigh;
OVRManager.display.displayFrequency = 72.0f;
FFR does not do anything to fix jagged edges though. If anti aliasing doesn't fix it, see if you can grab a screenshot and upload. 

odi0n
Honored Guest
Wow @Tolin93

Just impressive. That little bit you showed me, opened an ocean. I was able to search further into the areas you mentioned. Thanks a million. Just wow.  (Antialiasing worked! OVRPlayerController worked! I also added the scripts for 72hz & FFR)

Two final things if I may, I prefer if you point me the general direction - and let me do the ground work.

1) Character Locomotion: (I prefer artificial locomotion) I searched in the OVR Utilities. I added a OVRInput script, keeps saying something about cannot add monologue behavior (or something to that extent) I have no idea what that means as I am still new.  (I’ll search it later today) I also added I thought OVRManager, OVRHpatics - to no avail. 8’m stuck in place. Gravity is off.  

2) Scripting Basics - Easy Beginner Codes I Can Type To Stimulate Understanding:
Where can I find basic scripting - beginner code guides. Are these good start points for a beginner (who does not yet speak the language well)? 

https://unity3d.com/learn/tutorials/s/scripting?_ga=2.200465709.2099258873.1535786167-730217862.1526...

https://docs.unity3d.com/Manual/OculusControllers.html

https://unity3d.com/learn/tutorials/topics/scripting/getbutton-and-getkey?playlist=17117

I just want get up on basics with coding: locomotion, grabbing objects, interact with a door, open and close it, swing on rope, climb up on stuff, shoot projectiles... etc. 

and of course as I advance, transformation, Boolean, if statements... etc. 


@Tolin93 or anyone can help uplift, it’s greatly appreciated. 

Halfspacer
Adventurer
@odi0n

Glad it worked!
The thing about your two questions here is that they're the wrong way around. 
Bools, if statements, vectors and transforms etc etc can sound extremely unsexy to someone eager to get started making stuff. But really they're both the building blocks and glue that holds everything together. 

I often recommend this C# Introduction tutorial 
https://www.youtube.com/watch?v=gfkTfcpWqAY&list=PLTjRvDozrdlz3_FPXwb6lX_HoGXa09Yef&index=1

The things you learn are all the foundation of any C# script in Unity, so at the end of the playlist (It's 4 hours of tutorial vids in total - which one can easily get through in an evening, or an hour a day) you won't be an expert, but you will be familiar enough with C# to look at scripts and be able to figure out what's being 'said', and once you know that you'll have a much easier time figuring out what needs to change to get you where you want to go. 

I might for instance look at the OVRPlayerController script and see that it's using the thumbsticks for locomotion by default (The Go controller, unlike Rift, doesn't have thumbsticks - which is why you're not moving). 
It's this line that gives it away
Vector2 primaryAxis = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick);
(CTRL+F in Visual Studio brings up Search)

So then I look to 
https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/

And see that the touchpad is called PrimaryTouchpad. So we might swap that old line for
Vector2 primaryAxis = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);

And that should get you moving 🙂 

When it comes to shooting, grabbing, climbing, and interacting with objects -- I reeeallly suggest going through that Youtube tutorial series on C#. It will make everything a hundred times easier- Even when searching the internet for other people's code snippets (Code is rarely plug and play, especially for larger projects - so knowing how to adapt them to correctly fit your needs is key).