This blog serves as a guide to teach users how to set up a virtual camera inside of Unity using our Virtual Production. A virtual camera gives you the ability to control the camera within your Unity project with a Vive tracker. This allows you to walk within a 3D environment and set up specific camera shots that might only be done with a human director. Read on below to learn how easy it is to set up!
Note: Before proceeding below, make sure that you already have the Virtual Production kit setup with at least one Vive tracker online. If you need help setting this up, check out our blog Virtual Production Setup. You will also need to download these scripts and import them into your Unity project. Also, you must have at least a Studio Plus subscription in order to take advantage of data forwarding - see subscription plans here.
Rokoko Studio Setup
With the Virtual Production already setup and at least one Vive tracker live, add a camera prop to your scene.
Click on the orange camera icon at the bottom of the “Virtual Production” window
Assign your tracker to the camera prop
Click and drag the grey tracker icon within the “Virtual Production” window directly on top of “Camera-1” inside of the window
Note: To unassign a track from a prop, you can drag the tracker icon from below the prop to the grey box titled “Drop here to free tracker”. You may also simply drag and drop it on top of another prop to reassign it
Next, click the cogwheel icon at the top left of Studio and hover your cursor over “Data streaming”
Click to enable “Forward data”
Ensure that your ‘Forward IP’ address is set to the IP address of the computer you will be streaming data to
Ensure that your ‘Forward Port’ and ‘Forward VP port’ are different
Take note of what your ‘Forward VP port’ number is because it will be needed inside of Unity
Next, create an Empty game object within your scene and name it “Virtual Production”
Add the script “Virtual Production Receiver” to this empty game object by:
Dragging and dropping the script from the Project folder into the Inspector of the empty game object.
Or click ‘Add Component’ and search “Virtual Production Receiver”, and click it to add it
If you don’t already have a camera in your scene, make sure to create one by clicking the ‘Create’ button within your Hierarchy and clicking ‘Camera’
Click the Camera object within your Hierarchy and add the script “Virtual Production Prop” to it
Within the “Prop name” text field, input the name of the camera prop inside of Rokoko Studio.
By default it should be named “Camera-1”
Once done, click the Play button to test
If the camera starts moving when you move the tracker, then it works!
We hope that this guide has helped you learn how to set up a virtual camera within Unity. If you run into any issues during this process, feel free to reach out to our support desk or email email@example.com.
Introduction to Rokoko Studio and Essential Filters (locomotion, loop, treadmill, etc)