Forum rules - please read before posting.

Google Cardboard VR compatability?

Has anyone attempted, or succeeded in adding VR camera/controls -- like Google Cardboard -- to AC?



I was able to add the VR prefabs to a game camera -- which produced a stereoscopic camera view -- but unable to get the player to move around.

R

Comments

  • Be sure to use the "MainCameraVR" prefab in place of the regular AC MainCamera - you can find it in /Assets/AdventureCreator/Prefabs/Camera.  As for moving the player around, what are your Movement and Input methods set to?
  • I created a new First Person AC game, I then added the CardboardMain camera and the game builds and looks correct on a cardboard device with stereo view. My question is how do I get the cursor to appear in the center of both screens so a player can face an object to select it? I tried checking Settings>Lock cursor on screen's center when game begins, but the cursor appears in the center between the stereo camera's instead of in the center of each camera view.

    I know ChrisIceBox mentioned using the MainCameraVR prefab, but that just looks like a regular camera in Unity without stereo view. I guess I'm not understanding the use case for MainCameraVR.

    Any help would be appreciated, thx!
  • MainCameraVR differs in that the Camera component itself is on a child object - meaning it can be rotated independently of the object that the MainCamera component is on.

    When the game runs, the MainCamera will attach itself to the active camera - in the case of an AC First Person game, it'll attach itself to the FirstPersonCamera.

    If you are using a custom camera script, you can have the MainCamera attach itself by also adding the /AdventureCreator/Scripts/_Camera script - it'll then show up in camera-based Actions.
  • Hey y'all 
    Anyone got this to work ? 
    Cause, the maincameraVR prefab is not working on my end (I can start the game with it, but then , when I pass the cursor over a hotspot, it doesn't show and I have a error message in the console)

    fleep
  • And what is the error?  Please post the full message as it appears in the Console - any advice would only be guesswork without it.
  • hello, 
    I have this message :
    "NullReferenceException: Object reference not set to an instance of an object
    AC.PlayerInput.Grab () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1743)
    AC.PlayerInput.UpdateDrag () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1685)
    AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:591)
    AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:267)"

    But, If I keep the original prefab camera, and just deactivate the camera component, then copy the VR camera rig from google cardbord, it is working... 
    this only problem now is that the cursor is still at the center of the main camera and not on the VR camera... And the UI also is displayed over the main cam and not on my VR ones...

  • edited June 2016
    Just out of interest @andrax how are you planning to use VR with AC? With cardboard you have the problem that you only really have the magnet button as a controller. I have been doing some non AC experiments with "gaze control" (Gaze at a thing and that will, after a pause, cause an action) I guess THAT method could work in an AC game, especially if the levels were laid out with that in mind. (carefully spaced hotspots tat trigger the player to walk to them for example?)

    But how are you planning to be able to "click" on an AC UI? First, there is no click (ok magnet button) also with VR headlook, you need to be able to both look at things AND move to a HUD element... they kind of cancel each other out right?

    Very interested how you are planning this...

    VR is the future... man...


  • I just want a very simple system...

    I dont move, I can look around, when I look at somehting interactive, an icon apear and I can click to interact...

    To move I can look a some zone on the floor, or a window, a door... If I click, I just switch to another cam... 
    What will be long is to create all the cam and all the hotspot, but all in all it should be simple.
    Only issue is to call the inventory, or the menu, I ddidn't find an easy way yet...
  • edited June 2016
    Thanks for the bug report.  I have recreated the error message, and will begin work on a fix.
  • edited June 2016
    Thank you chris :)

    Have you planned to look at the cardboard sdk to maybe make a compatible rig in AC? 
    a new interface method  "Look and Click ' :)
  • A click registering when a hotspot is hovered over a given time?  This ought to be already possible using custom events.  There are events for when Hotspots are selected and deselected, so you may want to look into that - with so many VR platforms and interaction possibilities I would prefer to empower users through the API.

    Also know that there is a "World-space Cursor Example" script now - attach it to a mesh in your scene and it will adopt the position of the cursor in 3D space.  As it's only an example, you can open it to read the comments and change it to suit your own needs.
  • Update: To fix the error messages, tag the MainCameraVR's child object as MainCamera, not Untagged.
  • ok cool, thanks.

    In fact I don't even want a click after a hoover for some time, 
    I need a controller basically like a fps, the only thing is that I need all UI elements in world space and not on screen space...

    Can I do that ? I guess, I can switch all the UI prefab to world space, but then how to I specify where they are instantiated and what size they must have ?
  • You can make use of World-Space Unity UIs, but they have to be local to your scene, so that you can specify where they go exactly.  You may need to parent them to your MainCamera or Player.  To link with AC, you have to set your Menu's Source to Unity Ui In Scene, rather than Unity Ui Prefab.  Other than that, the steps are similiar to this tutorial.
  • Ok got it !
    It's working perfectly !!!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.