Forum rules - please read before posting.

Oculus Rift Cursor control

Hi everybody,

is there any way to integrate the Rift SDK with Adventure Creator and control the cursor via headmovement if I choose to use a fixed 1st-person perspective like in the AC physics demo?

Or would I need to use other assets like UFPs to achieve this?

Thanks!

Comments

  • When it comes to VR, the way you may want the cursor to be controlled may be different from game to game.  Therefore, AC provides developers with the API needed to tailor it to their own needs.

    First of all, be sure to replace the MainCamera prefab in your scene with the MainCameraVR one, which you can find in Assets/AdventureCreator/Prefabs/Camera.  This allows the VR camera to move additively to whatever camera movement you choose within AC - though you need to add whichever VR Camera component you want onto the child object in that prefab.

    Next, overriding the cursor can be done via custom scripting to override AC's own function to read the cursor position.  An example script can be found in Assets/AdventureCreator/Scripts/Static/WorldSpaceCursorExample.

    Attaching this script to a GameObject in your scene will cause the cursor to be placed at wherever the GameObject is in 3D space.  You still move the object (and thus the cursor) around with the mouse, but if you lock the cursor it will be placed in the centre of the screen.  Locking the cursor can be done within the Settings Manager - but you can also use the example script as a base from which to create your own.

    See Section 4.8 of the Manual for more on VR Cameras.
  • Great, thanks for the advice!
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.