I'm making an app for 360° video with Google Cardboard. I have the Easy Movie Texture plugin, but I can't find the way to make a UI. The controls appear on the left side. Is there a way to make them appear with the movement of the head?
create a canvas and attach as child of CardboardMain.
I use this method along with a reticle canvas to allow selection via gaze
Related
I have been trying to get a very simple demo of a native Unity UI canvas working with VR.
I have read the oculus blog post here: https://developer3.oculus.com/blog/unitys-ui-system-in-vr/ but i need to use the native unity UI as i want to redistribute the code without license worries.I followed this tutorial https://unity3d.com/learn/tutorials/topics/virtual-reality/interaction-vr?playlist=22946 and downloaded the unity vr samples project from the asset store. In this they provide some scripts to place on the camera (VRInput and VREyeRaycaster) and some scripts to place on the target object (VRInteractiveItem and ExampleInteractiveItem).
When i apply the target scripts to a regular GameObject in the scene (e.g. a cube) the raycast works fine and the appropriate calls are made when fire1 is activated. When i try and do this for a canvas object (e.g. a button) - no hit is detected. I have tried placing the two target scripts (VRInteractiveItem and ExampleInteractiveItem) on the canvas, the image containing the button and the button itself and none work. What am i doing wrong? Why would it work on a regular gameobject and not on a UI canvas? I have made sure all my canvas elements have their raycast target boolean property ticked
EDIT:
It seems to work when i attach a box collider to the UI element, is this required? i thought it should just work with a GraphicsRaycaster attached. but the configuration below doesn't work (when box collider is disabled and graphics raycaster is enabled)
This is what is on my players camera:
I dont have a problem using box colliders if i have to but i wanted to take advantage of the UI buttons changes in highlighted and pressed color properties
In Unity raycasting works only with game objects having colliders. Raycast returns true when it hits a collider. Without colliders there is nothing the ray can hit.
Unity Physics.Raycast documentation
I believe, for anyone just seeing this for the first time, a potential reason it is not working is because the canvas from the above picture is using a "Graphics Raycaster" element and not an "OVR Raycaster" element. The OVR Raycaster is meant to replace the graphics raycaster to connect Oculus to Unity UI.
If you want to use the unity's UI in VR you might want to take a look at this asset: VRTK
There are some examples of VR UI using controllers or camera targeting.
Go to your canvas, you should have an option that is "Plane Distance" it's set to 100 , I change it to 0.5 and it works quite well.
I'm currently creating a google cardboard vr app and I'm running into an issue for the UI. The VR app is set up to be on rails by creating an animation for an empty object that contains the google cardboard camera prefab. I have a world space canvas that has 3 UI objects (backwards, pause, and forward similar to the iphone). In the first case the UI works for pausing (time scale set to 0) as seen in the image below.
However the issue I'm having is having those UI icons show up while in motion. The icons seem to go off in a weird direction have a mind of their own - even though I can track the canvas and know it's in the same position relative to the camera. If I pause in game or in the editor it returns to the correct state in example 1.
I have the canvas set to world space and the event camera is the google cardboard camera prefab. I'm not sure what's going on.
I'm developing a toy object visualizer with Unity 3D and Google VR (specifically Cardboard). I'm using the default, Google-provided, GazeInputModule to allow the player to interact with the app UI. When the reticle is not over a UI element or a clickable 3D object, and the trigger is held pressed, I'd like it to cause the camera to rotate around the center of the object that's being looked at when the user moves his head (instead of rotating around its own center).
So what I basically need is a way to catch trigger events that happen over empty space or unclickable objects. How would one go about doing that?
I've tried looking at the Unity EventSystem docs and the Google GrazeInput docs but I'm not sure how to make it work in my case. (I don't need detailed code, I'm mostly not sure where to start).
I am developing an app with vuforia Cloud Recos. I want to add the feature of allowing the user to pause the page so she does not have to keep pointing the device on the target to view the trackable. This is pretty useful when I want to show texts. Is there anyway to achieve that on Unity3D ? A good example is Microsoft's Here City Lens app which includes a button to pause the page as the screenshot shows;
You could take a screenshot of the screen and apply it to an Image UI object. That is if you do not need the camera feed anymore.
If you need interaction with the elements, I would only take a screenshot of the camera feed without items. Get AR camera transform, apply it to a new camera, disable AR camera.Then apply the screenshot to a background plane covering the whole screen. Keep items on as well and they do not listen to Vuforia anymore. You are pretty much recreating a basic Unity scene. The items should not be moving with Vuforia, the camera is. So they are still in the middle and you need to know where was the camera when you took the shot. Your scene is complete
Currently there is no documentation whatsoever on how to make a "visor" HUD on Unity for a Cardboard game. Screen Space - Overlay does not work as rendering mode as many people have already said. Does anyone know of a workaround/method for making it using World Space rendering?
You must create your HUD in a World Space canvas, put it in front of the camera and attach it to the Head object of the Cardboard SDK. That way it will be always visible in front of the player.