Skip to main content
Up and Coming
June 10, 2015

Unity 5.1 FPS Controller Question

I have the new VR Supported Mode working now and removed all OVR Prefabs in place of Unity FPS controller, but one strange thing I just noticed.

The OVR FPS controller would use your head forward facing position when you walk or "Sprint" forward so you were moving towards where you were looking. Felt great and correct,

The standard unity FPS controller walks or Sprints but doesn't seem to update to your forward looking position as well, the result is looking forward but moving sideways a lot of the time.

It took me a while to figure out why I was all of a sudden getting major motion sickness feelings on my scenes that felt fine before.

Is there a checkbox somewhere I could use to correct this or am I missing something somewhere?. Thanks

I can provide links to two scenes, one built in 5.0.2 and one in 5.1 if that is helpful.
    This topic has been closed for replies.

    19 replies

    Inspiring
    June 10, 2015
    Yes, I noticed this as well. I think the new way actually makes more sense (like turning your head versus turning your body) but it does mean you sometimes end up in a weird off-center angle. Let me see if there is a way to change this.
    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
    June 11, 2015
    Thank you for looking into this. It totally makes more sense but somehow it doesn't "feel" right. After a few more hours of experimenting, I think it's also that you can never move your mouse or controller as accurately of carefully as you can move your head, so things also feel way smoother with the previous version. Maybe the unity controller just needs the addition of that check box to use head movement, so anyone could choose to go either way.
    j.j. morris - tekrok - https://share.oculus.com/app/tekrok
    New Participant
    June 11, 2015
    I found a quick fix for this, in FirstPersonContoller.cs.

    Change this line: (line 100)
     Vector3 desiredMove = transform.forward * m_Input.y + transform.right * m_Input.x;

    To this:
     Vector3 desiredMove = m_Camera.transform.forward * m_Input.y + m_Camera.transform.right * m_Input.x;

    Its kind of hacky but it works for simple control :)
    Up and Coming
    June 11, 2015
    Moving your feet with your head is gross.
    New Participant
    June 11, 2015
    I have the same problem.
    I think what the OP says, is that the way to move around our character, should be like in the Oculus demo (Oculus World Demo), we move our head and the direction is updated to face where we are looking at.
    At the moment, we look somewhere and when we walk forward we go to a totally different direction, and this makes everything ackward.
    The only situation I think this should not behave like this, is when we are in the control of a car, we don't want to turn the car with our head, but maybe a checkbox with an option or something ?
    Inspiring
    June 11, 2015
    In real life you generally walk in the direction your body is facing, not the direction your head is facing...
    New Participant
    June 11, 2015
    That's in real life, we are are doing games, not simulating real life.
    Up and Coming
    June 13, 2015
    jamiecurrie, that works perfectly thank you! just what I was after.

    BigB, exactly, well said:)
    j.j. morris - tekrok - https://share.oculus.com/app/tekrok
    Up and Coming
    June 15, 2015
    jamiecurrie, been using your fix a lot now, it's great!

    Now I have a more complex issue, that I am not sure if it is a unity thing, a physics engine thing or an oculus thing, but I am sure someone here can figure it out:)

    My game relies on shooting projectiles based off your head position, since you shoot from cannons on your helmet.

    I spawn a projectile prefab with a impuse force on a set axis at a set speed from a spawn point game object attached to my helmet that is also parented to the FPS camera etc. Everything moves perfectly with the head.

    The change to the FPS controller to use your head movement to also change your walking movement direction is perfect, however my next issue is that projectiles spawned from the helmet move only in the direction that the mouse or controller was last pointing and do not seem to be using the rotation of the head even though they are parented and physical moving in 3D space to the correct rotation to spawn from. I hope this make some sense, I am no engineer, so I am sure there is a simple explanation or fix for this.
    j.j. morris - tekrok - https://share.oculus.com/app/tekrok
    Inspiring
    June 15, 2015
    Try using the InputTracking functions to obtain the correct head orientation.

    http://docs.unity3d.com/ScriptReference ... cking.html
    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