Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
SiggiG's avatar
SiggiG
Protege
12 years ago

Unity 3d SDK feedback

Decided to start a thread to post feedback on and discuss the Unity3d SDK. So far so good and it's very easy to import and use :)

I've made one small tweak to the default camera script that I found very useful so maybe it's something you'd want to include in the SDK by default? It's a simple swap between absolute headset rotation and being offset by the parent object. This way you can put the OVRCameraController into another container and still look around relative to that container, for example when inside the cockpit of a spaceship.

OVRCamera.cs

New property:

// Set to true if you want the camera rotation offset by parent rotation, useful when putting the user inside a vehicle
public bool OffsetByParent = false;


And a change inside the SetCameraOrientation method:

// Update camera rotation
if (this.OffsetByParent == true)
{
gameObject.camera.transform.rotation = gameObject.transform.parent.transform.rotation * q;
}
else
{
gameObject.camera.transform.rotation = q;
}

13 Replies

Replies have been turned off for this discussion