Forum Discussion
davidmcclure
13 years agoHonored Guest
Help! Trouble Parenting Hydra Objects To OVRPlayerController
I am trying to set up a scene where the player has 1:1 control over a pair of handheld objects using the Razer Hydra. Currently I can achieve the following: Set up a scene with the OVRPlayerContro...
davidmcclure
13 years agoHonored Guest
longshot, Krisper, thanks for the responses.
Krisper:
I had tried parenting the Hydra hands to the OVRPlayerController but every time I played the scene in Unity it crashed. I have since found out that this is just a problem I am having when I launch a scene using the Hydra more than once - I will contact Sixense about this. I made a new scene by saving out the Hydra hands and I can confirm that parenting them to the OVRPlayerController worked fine.
longshot:
I hadn't been using transform.localPosition, so I gave this a shot. Unfortunately, I can't seem to get it working properly and I still have to convert the output from the Hydra to a smaller 'arms length' scale. I think I should be able to test what I wanted to test fine using the hands, but I would like to get to the bottom of this. I've included my code below; I'm afraid I'm not a coder, so it's not very good at all.
Krisper:
I had tried parenting the Hydra hands to the OVRPlayerController but every time I played the scene in Unity it crashed. I have since found out that this is just a problem I am having when I launch a scene using the Hydra more than once - I will contact Sixense about this. I made a new scene by saving out the Hydra hands and I can confirm that parenting them to the OVRPlayerController worked fine.
longshot:
I hadn't been using transform.localPosition, so I gave this a shot. Unfortunately, I can't seem to get it working properly and I still have to convert the output from the Hydra to a smaller 'arms length' scale. I think I should be able to test what I wanted to test fine using the hands, but I would like to get to the bottom of this. I've included my code below; I'm afraid I'm not a coder, so it's not very good at all.
public class SixEnseInputGet : MonoBehaviour {
public GameObject LeftHandObject;
public GameObject RightHandObject;
public GameObject PlayerObject;
// Use this for initialization
void Start () {
LeftHandObject = GameObject.Find("Torch");
RightHandObject = GameObject.Find("Gun");
PlayerObject = GameObject.Find ("OVRPlayerController");
}
// Update is called once per frame
void Update () {
LeftHandObject.transform.localPosition = SixenseInput.Controllers[0].Position;
RightHandObject.transform.localPosition = SixenseInput.Controllers[1].Position;
LeftHandObject.transform.rotation = SixenseInput.Controllers[0].Rotation;
RightHandObject.transform.rotation = SixenseInput.Controllers[1].Rotation;
}
}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
- 4 years ago
- 2 years ago