Detecting a Tilt event on google cardboard not working - unity3d

I'm trying to go back from one screen to another using Application.LoadLevel(0)
when the user tilts his head with the cardboard.
if(Cardboard.SDK.Tilted)
//do whatever
However Cardboard.SDK.Tilted is always false when I tilt the device in the unity editor using the mouse or when I build and run the app. Any idea why?

Okay so turns out it was working. Just in case someone reads this, in Unity if u press control then move the mouse it will Tilt but it won't trigger the event as Tilted. To do that you have to press the Escape key and it will simulate a tilt event.

Related

VRTK/Unity3D/Vive VR, Touchpad Control, Move with Touchpad press, Input sometimes not received, why?

I am trying to use the Touchpad Control of the VRTK Asset for Unity VR.
With Touchpad Touch it seems to work fairly fine, but for a more direkt input, we would like the player to actually press down on the TouchPad and hold to walk in a certain direction and to not have players accidentally activating the touchpad by just barely touching it.
Since VRTk has a Primary Activation Button for this change, this wasn't too difficult to achieve.
But the input of both controllers is sometimes read and sometimes not. Sometimes the Player presses on the TouchPad but the Player does not move. Other times it works just fine.
Anybody have an idea why this would happen and maybe, what I could do, to always get my input and walk when the player presses the button?
At the moment sometimes it doesn't react to it instantly, mostly it reacts a few milliseconds later after pressing the touchpad and often it doesnt read the input at all.

Cursor not showing

As we develop a little game with defold (defold 1.2.102 | defold editor 2) we encountered the following problem:
When we start our game the window shows everything we built properly and there are no build errors or error console logs. However there is no cursor. Neither on the levelscreen of the game nor on one of the other monitors. We added a keypress input for testing the buttons and it worked properly, but the problem remains: Where is our mouse pointer? Do we have to add or adjust it somehow?
Thank you for your help!
Are you running your game in fullscreen mode? Defold always hides the mouse pointer while running in fullscreen mode. You can add a game object with a sprite (or even better a gui box node) and let that follow the mouse coordinates and use it as a custom pointer for your game.

Unity - I cant see my mouse on screen

I have made a simple 3D game in Unity and for the most part everything works, but when my player dies the mouse is not visible on the death screen.
I have two other scenes with what looks like to me the same exact settings, yet the mouse on those is visible.
Try to check your script. search for Cursor.visible
https://docs.unity3d.com/ScriptReference/Cursor-visible.html

Listen for GazeInput down event without selecting anything - Google VR Unity

I'm working with the Google VR Unity SDK and I'm trying to create a VR application where users can switch between multiple ambients(places). I want them to switch to a different ambient just by pushing down the magnetic sensor of the cardboard, pointing anywhere. My problem is that every link (like this one) I've found, works with objects selection. I've tried adding an Event Trigger to my Main Camera and adding a Mesh collider to my building but none of them worked.
So, ¿is it possible to listen for the magnetic sensor pushdown in the full scene without having to select an object?
Turns out it's simpler than I thought.
if(Input.GetButtonDown("Fire1")){
//some code
}
Thing is googleVR removed magnetic button support since version 0.9.0 and I was using 1.0.3. So if you want to implement a trigger for cardboard's magnetic button you need to use v0.8.5.
You could put up a Canvas that's attached to the camera in World Space, so that it always stays in the line of sight. Add a Button to the canvas at the location where the gaze input cursor is, and you should always hit that when triggering.

simple UI menu and canvas for DK2

I am using Unity 5.1.2p3 with DK2 SDK 0.6.0.1 and I understand from this post that Screen Space - Overlay is not supported in Unity VR. It is recommended to use Screen Space - Camera (which in my case does not work) or World Space (which I am using now) but I need someone to help me understand how I get simple menu with buttons and toggles to show as a still image and how I can make selections and button presses with my mouse cursor.
I have created a menu for my app, with 4 toggles and 1 button. When I check the Virtual Reality Supported option with the Oculus being in Direct Mode and Canvas being in World Space, I can see it in VR, but I cannot see/find my mouse cursor to tick one of the toggles.
When I take off the headset, on my monitor's Game View tab, I can see and even use the mouse and select a toggle. Obviously, I have to keep the headset steady, so in my Game View, things do not shake!
Another thing I notice is that the VR camera is the same as the Main Camera in the Unity Hierarchy, but when I take off the headset and move it around, the position of the camera does not change, only looking up and down and around is reflected.
How do I simply do a static menu like a 2D surface that does not move in VR and a user can use button presses and muse clicks with the headset on? What settings are required for this way of doing UI and canvas stuff? There are 2 attachments, showing my current settings...
Are you specifically wanting to use the mouse? If you look through a blog entry I wrote below, it will show you how to use Gaze looking to trigger menu buttons:
http://talesfromtherift.com/vr-gaze-input/
You can achieve this by some code I list there that raycasts from the center of the screen and if it hits any UI, it will trigger the correct events and make it clickable by button (or by time).