How to invert camera/controls for Unity Android VR App? - android

I have a fresh project in Unity with the Google Cardboard SDK imported. Default orientation is set to Landscape Right.
Whenever I load up the build on my Android device, everything is upside down. Also, if I look left in real life, it turns my head right on the phone, and vice versa. The camera and controls seem to be inverted.
I've somewhat fixed the camera problem by rotating it 180 degrees. Great. But, my controls are still inverted.
What I need to know is how to invert controls on Unity. Or some way to fix this problem.

There's a bug in the SDK v0.4.10. Check out the repo issue.
You can either downgrade to the v0.4.9 or upgrade to Unity 5. I suggest both.

Related

A-Frame AR.js on android portrait mode not showing in place

I am developing a webAR using AR-js and A-frame, works perfectly with iPhone in landscape and portrait mode BUT in android only in landscape, when in portrait all augmented reality is not shown on the trigger image (Image Target ), appears shifted sideways and quite unsteadily. Is there any way to fix this?
I'm using a template based on the example at https://medium.com/swlh/ar-js-the-simplest-way-to-get-cross-browser-augmented-reality-on-the-web-10cbc721debc:
I also got the same issue some days back. It is because in aframe-ar doesn't have provision to correct the orientation shift(90 deg rotate). It might be working on the iPhone because of the auto-rotate. Try in android with auto-rotate(It may work).
Use console.log(event.details.intersectedE1) to know the exact
position of the trigger event.
I think this might help you out.
Caution: iPhone safari doesn't allow console.log().

Why does my Android studio preview look different?

I'm wondering why in every tutorial I watch the preview section looks like this: i.e it has the actual device shown as preview and has a button for linking it to an activity
When mine looks like this: for some reason doesn't have the device
I'm sure I've just not installed something correctly or not clicked a checkbox, or a version of something is wrong but after some googling i can't seem to work out what it is. Any help would be greatly appreciated.
Newer versions of Android Studio do not show the device bezel by default. Everything looks installed correctly.
Look at the Android Studio window title.
Your video is using 2.0 Beta, and your newer version just doesn't have the bezel.
You'll also notice there's different buttons around the screen preview area.
You could disable it in older versions, I'm not sure if it's completely gone but it was probably removed because it took up screen space and didn't serve much purpose

Incorrect animation when building and deploying game to Android device

After I build and deploy my game to an Android device, my animation displays incorrectly. The image below demonstrates the issue.
I don't know how to fix this. What may be the cause of the problem, and how can I fix it?
p/s: I use unity 5.1.1f1 , Win 8.1
Set your Camera's Clear Flags parameter to Solid Color

Unity3D + Google Cardboard SDK = No UI masking

UI mask do not work with Google's Cardboard SDK? It works properly with the Oculus Mobile VR plugin but with the Cardboard SDK the masks seem to be gone.
http://postimg.org/image/b2by7exu9/
This screenshot demonstrates it, outside of the white box we should not see any text.
http://postimg.org/image/ts8wgfu7l/
In editor and with VR Mode disabled it looks fine.
Did anybody encounter this issue and know how fix?
In which direction should I investigate further?
I already tried the builds on Note 4 and Galaxy S3 with two different projects just to be sure. Logs didn't show striking lines. I googled and did not found anything related to this issue. Answers and forums the same.
Any suggestions highly appreciated!
While not an answer to your question - I figure after this long any information could be helpful:
I've noticed that the Cardboard SDK in general doesn't play nice with the Unity UI at times. I found that when enabling or disabling VR mode on Cardboard, my UI would cease to respond to touch inputs on other (2D) scenes. I solved this by turning VR mode before changing scenes. So perhaps you need to dig around inside Google's code to see where it's messing with your UI...
have you re-tested with Unity 5.3? there were a bunch of improvements in this area including a re-write of the masking system.
Alternatively, check out the UI Soft Alpha mask component as part of the UI extensions project (https://bitbucket.org/ddreaper/unity-ui-extensions) which is a shader based mask system with Alpha support
Hope this helps
I discovered this still happening in Unity 5.6.0f1 with Google Cardboard. I was able to fix it by going into the Cardboard SDK settings (PlayerSettings (Android) -> Other Settings -> Virtual Reality SDKs -> Cardboard) and switching the depth format to "24-bit depth | 8-bit stencil" (since the UI mask uses the stencil buffer). This solved the masking problem for me.

Switch platform spotlight not working?

this is the built version
this is the game view version
settings
it was working fine before and building the same untill i switched platforms and built web player version and google native client version, i cannot find anything on it, before i built the other version it was just for android, im trying to revert back so they will build the same on android again, im looking for some insight on this, thank you for your time
Seems like you have to adjust your quality settings. In Unity 3.5.x go to Edit / Project Setting / Quality and ensure that more than 0 pixel lights will be rendered and shadows are enabled. I have not yet upgraded to Unity 4 but it should be similar there.
Be aware that this affects rendering performance.

Categories

Resources