Forum Discussion

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

Potential Bug in OVRPlayerController.cs (0.6)

I was monkeying around in OVRPlayerController to get it to work in both VR and non-VR mode, and I believe I've found a bug in the code.

Line 248 reads:
MoveScale *= SimulationRate * Time.deltaTime;

which is used to scale the inputs independent of frame rate.

Later at line 301, the controller axis inputs are scaled using a moveInfluence of:
moveInfluence = SimulationRate * Time.deltaTime * Acceleration * 0.1f * MoveScale * MoveScaleMultiplier;

This scales by SimulationRate * Time.deltaTime twice, which I believe mucks up the frame rate independence. Higher frame rates slow down player movement. I believe the line should read:

moveInfluence = Acceleration * 0.1f * MoveScale * MoveScaleMultiplier;


Can anyone verify my thinking? Thanks.
Replies have been turned off for this discussion