Skip to main content
Up and Coming
November 21, 2014

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:

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!
    This topic has been closed for replies.

    8 replies

    Inspiring
    November 21, 2014
    Can you let me know specifically what you're trying to accomplish?

    There may be another way to do it.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Inspiring
    November 21, 2014
    Check in the OVRPlayerController inpector. There is a checkbox called "Hmd rotates Y".

    I think you just need to uncheck the box.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    November 21, 2014
    thanks Cyber, will try in the morning, am pretty bombed right now :) but will definitely try it out ;)
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.
    Up and Coming
    November 21, 2014
    I 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 :)
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.
    Inspiring
    November 21, 2014
    If 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.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    January 23, 2015
    Hi Cyber and everyone else WHO are still struggling with this...

    I have finally found a simple yet doable solution with the folloing code

    public 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
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.
    Inspiring
    January 23, 2015
    Thanks so much for following up with the solution and marking it as solved.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    January 23, 2015
    You're most welcome Cyber ;) I am just glad if i can be of any sort of help :D
    ASUS Maximus VII Formula Intel core i7 quad core 4790K OC'ed @ 4.4Ghz 32GB DDR3 Ram Nvidia Geforce GTX 980 4GB Windows 10 Pro 64bit GSync Monitor @ 2560x1440, 144Hz ------------------------------------------- DK2 Owner CV1 Preordered.