Forum Discussion
standtall007
12 years agoProtege
How to make head movement like before??? [Solved]
Hi there, it has been a while since i last posted in here, but that is mainly due to the fact that i have an unsolved question... in SDK 0.4.2 i had fixed my issue by changing two line of code from (vector3.up / .forward) to (transform.up / .forward) in the OVRCamera.cs but that is now impossible because the file from 0.4.2 does not exists anymore, and also i cannot find the same lines of code anymore, these lines to be precise:
those two lines i just need to change to:
where target is :
but that is not good enough with the new SDK, so i am asking for assistance to how to make the same functionality in 0.4.3 (or whichever is the newest SDK!) as there was in 0.4.2,
Thanks in advance!
~David
P.S: the two lines can be found (before adding the public variable!) at : 287 & 288!
Vector3 dir = qp * Vector3.forward;
qp.SetLookRotation(dir, Vector3.up);
those two lines i just need to change to:
Vector3 dir = qp * target.transform.forward;
qp.SetLookRotation(dir, target.transform.up);
where target is :
public GameObject target;
but that is not good enough with the new SDK, so i am asking for assistance to how to make the same functionality in 0.4.3 (or whichever is the newest SDK!) as there was in 0.4.2,
Thanks in advance!
~David
P.S: the two lines can be found (before adding the public variable!) at : 287 & 288!
8 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionCan you let me know specifically what you're trying to accomplish?
There may be another way to do it. - cyberealityGrand ChampionCheck in the OVRPlayerController inpector. There is a checkbox called "Hmd rotates Y".
I think you just need to uncheck the box. - standtall007Protegethanks Cyber, will try in the morning, am pretty bombed right now :) but will definitely try it out ;)
- standtall007ProtegeI just tried to find the Hmd Rotates Y but i don't have it on my OVRCameraRig GameObject, or under any of it's child objects!
What can i the do??? i am using the OVRCameraRig prefab and Not OVRPlayerController prefab!
Thanks for trying though ;)
I really appreciate that someone is trying to help me out :) - cyberealityGrand ChampionIf you are using a custom player controller object, then the issue is likely in your code. You should have full control over how and where your controller moves, and this would be independent of the camera rig.
- standtall007ProtegeHi Cyber and everyone else WHO are still struggling with this...
I have finally found a simple yet doable solution with the folloing codepublic GameObject playerBody;
public Transform centerEyeAnchor;
void Update ()
{
if(playerBody)
{
playerBody.transform.rotation = Quaternion.Euler(0f, centerEyeAnchor.eulerAngles.y, 0f);
}
}
just copy it if you find it useful.
Though i must pinpoint that this can only be of use (i think!) if you're going to use it with a custom character script!?
Also i want to thank you Cyber for your help, it was your comments in here that finally led to my solution :P Thank you.
Oh, btw, this Works at least on 0.4.4 of the unity 4 integration, however i cannot say that it Works the same in 0.4.3!
Cheers,
Standtall007. :D - cyberealityGrand ChampionThanks so much for following up with the solution and marking it as solved.
- standtall007ProtegeYou're most welcome Cyber ;) I am just glad if i can be of any sort of help :D
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
- 11 months ago