Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
olas72's avatar
olas72
Honored Guest
5 years ago

Non-Camera relative movement with the OVRPlayerController

So it looks like its coming from this code.   But maybe I'm just looking in the wrong place.   I want the movement to always go in the same direction regardless of head orientation.  Any ideas would go a long way.   Thank you.

OVRPlayerController.cs

moveInfluence = Acceleration * 0.1f * MoveScale * MoveScaleMultiplier;

            if (primaryAxis.y > 0.0f)
                MoveThrottle += ort * (primaryAxis.y * transform.lossyScale.z * moveInfluence * Vector3.forward);

            if (primaryAxis.y < 0.0f)
                MoveThrottle += ort * (Mathf.Abs(primaryAxis.y) * transform.lossyScale.z * moveInfluence *
                                       BackAndSideDampen * Vector3.back);

            if (primaryAxis.x < 0.0f)
                MoveThrottle += ort * (Mathf.Abs(primaryAxis.x) * transform.lossyScale.x * moveInfluence *
                                       BackAndSideDampen * Vector3.left);

            if (primaryAxis.x > 0.0f)
                MoveThrottle += ort * (primaryAxis.x * transform.lossyScale.x * moveInfluence * BackAndSideDampen *
                                       Vector3.right);  

moveDirection += MoveThrottle * SimulationRate * Time.deltaTime;

      Controller.Move(moveDirection);
Replies have been turned off for this discussion