0
votes

I'm using Unity 5.3.4 to create an Android game for the Samsung Gear VR. I'm able to walk around in my scene with my bluetooth controller using the FPSController from the Standard Assets package. However, the player moves in the direction its (non-existent) body is facing, not in the direction he's looking at. This makes walking around rather unnatural because "moving forward" doesn't move the player forward.

I have found several solutions for this around a number of forums, but none seem to work. How can I achieve this behaviour?

1

1 Answers

2
votes

Found a working solution by changing the C# code in FirstPersonController.cs:

Change line 100 in method FixedUpdate() containing

Vector3 desiredMove = transform.forward*m_Input.y + transform.right*m_Input.x;

into:

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

This way the current transform of the Camera is used to calculate the desired player movement.