Forum Discussion
Infinite
12 years agoHonored Guest
Human scans in Unity. Unity dev help needed.
Hi all, I'm trying to find the right place to ask if anyone can help me with Unity. I'm trying to publish some nude human scan assets so people can view them with Unity on the Rift. Similar to thes...
dbuck
12 years agoHonored Guest
got a ton of variations of that, let me package one up for you ;)
*time passes*
This should work for you, save as FlyCamera.cs somewhere in the project
Drag in the Assets/OVR/Prefabs/OVRCameraController prefab into the hierarchy window
then add this script to the root of the prefab in the scene
delete the old 'maincamera' since it's no longer needed
then in the menu, we need to add an axis to use for up/down, so:
go to Edit -> Project Settings -> Input
click the little arrow to expand the list
select the first 'Vertical' item in the list
hit Control-D (or Command-D if in OSX) to duplicate the item
in the now duplicated version, go in and change the Name to FloatUPDOWN and the Negative/Positive buttons to C/E respectively..
It's pretty no-frills, but it'll get you started. mostly taken from the unify wiki somewhere if I remember correctly.
Unfortunately I left the rift at work this weekend, or I'd make sure it worked for real ;) if not, i'll dig it up next week if you're still stuck.
Cheers.
*time passes*
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
public float Speed = 1;
public bool DontRequireMouseclick = false;
private Vector3 _moveDirection;
void Update () {
if (Input.GetMouseButton(0) || DontRequireMouseclick)
{
_moveDirection = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("FloatUPDOWN"), Input.GetAxis("Vertical"));
if (_moveDirection != Vector3.zero)
{
_moveDirection = transform.TransformDirection(_moveDirection);
_moveDirection *= Speed * Time.deltaTime;
transform.position += _moveDirection;
}
}
if (Input.GetKey(KeyCode.RightBracket))
{
Speed = Speed + (Time.deltaTime*15);
}
if (Input.GetKey(KeyCode.LeftBracket))
{
Speed = Speed - (Time.deltaTime*15);
}
}
}
This should work for you, save as FlyCamera.cs somewhere in the project
Drag in the Assets/OVR/Prefabs/OVRCameraController prefab into the hierarchy window
then add this script to the root of the prefab in the scene
delete the old 'maincamera' since it's no longer needed
then in the menu, we need to add an axis to use for up/down, so:
go to Edit -> Project Settings -> Input
click the little arrow to expand the list
select the first 'Vertical' item in the list
hit Control-D (or Command-D if in OSX) to duplicate the item
in the now duplicated version, go in and change the Name to FloatUPDOWN and the Negative/Positive buttons to C/E respectively..
It's pretty no-frills, but it'll get you started. mostly taken from the unify wiki somewhere if I remember correctly.
Unfortunately I left the rift at work this weekend, or I'd make sure it worked for real ;) if not, i'll dig it up next week if you're still stuck.
Cheers.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 days ago
- 9 months ago
- 1 month ago