How To Get The Razer Hydra Working With Unity 3D

by Hugh Hancock on August 2, 2013

OK, this one isn’t strictly an Oculus Rift-only post, but it’ll be useful for a lot of Rift developers, as the Razer and the Rift go together extremely well. Hydra

I’ve been doing some development work with the Razer Hydra recently, and it’s less than easy to persuade it to work with Unity 3D. So, here’s a quick guide to getting the usual Razer “Hands” working with your controller in Unity.

By the way, I’ll freely admit I’m not the most expert developer out there, so if there’s a better way to do this, I’d love to hear about it!

*Note: You’ll need Unity Pro to use the Razer Hydra, as it requires a .dll plugin. To the best of my knowledge, you can’t develop with the Hydra in Unity Free.

Step 1: Get The Razer Hydra Plugin

Go into the Unity Asset Store in Unity, and search for “Sixense Hydra”. Install and download the plugin.

Note that you don’t need any drivers for the Hydra installed – it’ll work without them.

Step 2: Open the sample scene.

Save your current scene.

In your “Project” window, go to the Sixense Sample Scenes folder:

HydraDeveloper

Open the SixenseHands project.

Step 3: Copy The Hands

OK, this might seem like cheating, but it’s the easiest way I’ve found to get Hydra support into another project.

From your Hierarchy window, select and copy the “SixenseInput” script, and the Left Hand and Right Hand trees of assets.

Now, close the SixenseHands project, open the project you want to use Razer Hydra control in, and paste in all the things you just copied.

Step 4: Assign parent.

If you’re using a FirstPersonController in your project (as you probably will be) drag the Left Hand and Right Hand onto the Main Camera, which is a child of the FirstPersonController.

Now, double-click one of the hands to center the view on them, and move them next to your First Person Controller. Move and scale them until they’re placed where you want them relative to the controller’s camera – you can click on the MainCamera to get a look at where they’ll be when the game starts up.

Step 5: And that’s it!

You can now start your game up, and after running through the on-screen prompts, you’ll have hands controlled by your Razer Hydra in your game. You can also now add scripts to the hands – collision, triggers, etc – and they’ll work as usual in Unity.

Accessing the buttons is a slightly different kettle of fish, and I’m still figuring out how to do it. If people are interested – let me know! – I’ll do a second part of this tutorial about that.

I hope that was useful! What would you like to see a tutorial on next?

Want to hear when there are new guides on Oculus Rift Info?

Follow us on:

RSS | Google Plus | Twitter

{ 8 comments… read them below or add one }

Scott September 18, 2013 at 4:56 pm

I thought this was great and really helpful, I’d love to see the second part covering the buttons :)

Reply

mdko September 30, 2013 at 1:30 pm

Heya,

Good tutorial, but now i’m just trying to use the razer hydra to control my character in Unity, in combination with the Oculus Rift. Any idea how? I dragged the sixenseinput script around to my OVR player controller but that doesn’t do much (apart from crashing unity)

Reply

Hugh Hancock September 30, 2013 at 1:46 pm

You’ll need to grab the inputs from the joystick and manually edit the OVR controller script to accept those instead of the standard joystick inputs.

Check the Razer Hydra inputs sample project to get the names of the inputs.

Hope that helps! I’ll do a follow-up tutorial at some point, not sure when though.

Reply

Dylan October 16, 2013 at 4:00 am

Does this work with Unity Pro and Mac? Would the Hydra work without drivers installed on Mac OSX 10.8?

Reply

WiredEarp October 25, 2013 at 1:16 am

Great tutorial, saved me some time when I was first trying to do this. Thanks!

Reply

MacBoof November 9, 2013 at 11:15 pm

Great stuff! Please do a follow-up explaining how to integrate the buttons, it’s driving me mad!!
Thanks

Reply

Dhaval Kesaria (DK) March 5, 2014 at 11:53 am

Hi, Hugh Hancock

I am making a cricket game with Oculus Rift and i want to move my Bat according to the user hand using Razor Hydra to get the accuracy in the game.

So can i do that..??

And yes i am using Unity3D pro only.

And yes one more thing this game is totally made by me and my friend who is a 3D Artist.

So please help as soon as possible.
Waiting for your reply.

Thanks in Advance.

Reply

Hugh Hancock March 26, 2014 at 11:18 am

Yep, that’s doable. The accuracy won’t be 100% perfect, but should be pretty good.

Reply

Leave a Comment


+ seven = 10

Previous post:

Next post: