Skip to main content
New Participant
July 9, 2013

[Script] Test your Rift inside the Unity Editor

Hello! I've made an editor script that allows you to work with the Rift in Unity without having to build every time you want to test something. It's designed to work with any HMD, so long as it acts as a separate monitor in the OS you're using. All you need to do is specify where the top-left corner of your Rift is in pixel coordinates, where (0,0) is the top left of your primary monitor.

You can find it under "Window/Set Game Window Position..." in the editor.

I haven't been able to test this on OSX. Please let me know if something doesn't work!
    This topic has been closed for replies.

    19 replies

    Up and Coming
    July 10, 2013
    Waow many thanks ! This will come in handy !
    Rift 3d models available here : viewtopic.php?t=1514
    Up and Coming
    July 10, 2013
    Beautiful! Thanks!
    Up and Coming
    July 11, 2013
    I just remove the game window from dock and make it fullscreen....but this might make it a bit easier!
    -Stuart Bradley Newsom HS-51XXXXX Mar 21, 2014 01:09 AM PDT DELIVERED Portfolio: http://sbnewsom.com Facebook: Click Here
    Up and Coming
    July 11, 2013
    O-o I just mirror my main window and maximized on play. Not 100% accurate, but pretty darn good.
    Current Project: Virtual Reality Glove project
    Inspiring
    July 11, 2013
    This is awesome. Thanks.

    However, I'm moving it to the Unity forum.
    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
    Inspiring
    July 12, 2013
    I showed this script to some of the guys here and I think we will want to integrate it into the official SDK.

    Great job.
    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
    July 12, 2013
    Wow, this works great.

    And it should be possible to automatically set the right coordinates by querying the device ID from the oculus apis, and then using System.Windows.Forms.Screen or the Win32 display device enumeration callback from within the SDK DLL.

    It would be even cooler if the OVRDevice class did all that when you hit play with a Rift connected, for zero config.
    seieibobAuthor
    New Participant
    July 22, 2013
    Hey, thanks for all your feedback. I'm really excited to possibly see this in the SDK! There are quite a few improvements I can make, which I intend to do.

    And it should be possible to automatically set the right coordinates by querying the device ID from the oculus apis, and then using System.Windows.Forms.Screen or the Win32 display device enumeration callback from within the SDK DLL.

    It would be even cooler if the OVRDevice class did all that when you hit play with a Rift connected, for zero config.


    I hope to do something like this. I wrote this code in an hour, so there's a lot that can be done with it. Now that people are actually seeing code I wrote, I'm a little self-conscious...
    Up and Coming
    July 26, 2013
    Thanks, seieibob! Looking forward to seeing the next steps. (No pun intended.)
    — Morgan — Mac OS X ❆ Unity
    Up and Coming
    July 27, 2013
    thanks for making this. this works much better than the crappy one I did!