Skip to main content
Inspiring
November 12, 2013

Basic Unity scripts for Rift demos

I'm guessing everyone developing with Unity eventually starts putting together useful scripts to add to their library for re-use and to speed up prototyping. I'm still learning Unity, but I've got a few scripts I'd like to share. Perhaps others could do the same?

I'll start with a pretty basic one called "Rift Demo Basics" that comes in the form of a tiny prefab that:

  • Lets you show/hide a frame-rate indicator (Configurable),

  • Lets you toggle Unity vsync (Configurable),

  • Hides your mouse cursor,

  • Makes it so that hitting Escape will quit (Configurable).

Download: RiftDemoBasics.unitypackage

I noticed several people relying on video capture software like Fraps to show the framerate of a demo, and others have lamented the lack of ability to turn vsync on/off in a demo (by default they are on in Unity demos with Rift integration). And of course, many demos don't hide their immersion-breaking mouse cursor, which for me personally is a pain to move it out of the way so that I can't see it, and at the same time try not to move it to the edge of the screen which does things in Windows 8.

The Unity package at the link above comes with a "Root" prefab which you can just drag into your scene hierarchy and it's set up to hide your mouse, turn vsync off, and show a framerate indicator in the upper right (can't be seen when wearing Rift).

Hope this helps someone!

    7 replies

    Inspiring
    November 14, 2013
    Cool. Looks like it's working good.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    November 18, 2013
    I just started with Unity, but this sounds very good! My expirience with some Demos the ESC dont work
    and/or Mouse sitting in front, thats really annoying.

    Thanx!
    Order DK1 Mar 30, 2013 / Order DK2: Mar 19, 2014 / Order CV1: Jan 6, 2016 / Order HTC Vive Feb 29, 2016
    New Participant
    November 22, 2013
    Thank you, this will help me as I learn unity for my projects.
    January 1, 2014
    Interesting post, it's a pity it is not so partecipated.

    I'm trying to do my first OR Unity games in these days, as soon I have something useful I'll post it here :)
    drashAuthor
    Inspiring
    January 3, 2014
    I thought I would add my own VR-friendly skysphere package. There's already two that I know of on these forums:

    Nora's script apparently works great and can be found here.

    adam posted a packaged version of the skybox that can be found in the Tuscany Unity demo scene here.

    My own basic skysphere script that I use for rapid prototyping can be downloaded here, although it is geared toward using a single a single texture as your backdrop drawn on the inside of a sphere. A script for keeping it centered on your view is included. To use, drag the "Skysphere" prefab into your scene and check out the included readme for some tips on getting the most out of it.

    "0perator3" wrote:
    I'm trying to do my first OR Unity games in these days, as soon I have something useful I'll post it here :)


    Glad to hear it 0perator3, looking forward to seeing what you come up with. :)
    Titans of Space PLUS for Quest is now available on DrashVR.com
    New Participant
    April 17, 2014
    Thanks for the unity package.
    Up and Coming
    April 26, 2014
    I've been lurking here for months, but had to say: Drash, you rock!

    Thanks so much for sharing these wonderful scripts. These are big pet peeves and will make VR experience better for everyone.

    And also crazy thanks for providing my first 'wow!' VR experience with Titans! :D
    Cubicle Ninjas Custom VR App Development Guided Meditation VR for Rift, Gear, and Go