Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

NaN problem with Editor emulator #947

Closed
CenekStrichel opened this issue Aug 6, 2018 · 3 comments
Closed

NaN problem with Editor emulator #947

CenekStrichel opened this issue Aug 6, 2018 · 3 comments

Comments

@CenekStrichel
Copy link

Summary:
From Unity 2018.2+ you can not use emulator GVRController with TimeScale = 0
It happen only in editor. Build looks ok.

Steps to reproduce the issue:

  1. Open HelloVR scene in Unity 2018.2+
  2. Unhide GvrControllerMain
  3. Set Time Scale to 0
  4. Play
  5. Hold ALT + SHIFT + mouse move
  6. You get this
    image
@ddrocco
Copy link

ddrocco commented Aug 25, 2018

In MouseControllerProvider.cs, there's a method called private void UpdateOrientation(). In it is the line state.gyro = deltaDegrees * (Mathf.Deg2Rad / Time.deltaTime);. Replace this line with the following:

if (Time.deltaTime > 0f) { state.gyro = deltaDegrees * (Mathf.Deg2Rad / Time.deltaTime); } else { state.gyro = Vector3.zero; }

I'll try to get an official fix out for this shortly.

@CenekStrichel
Copy link
Author

Working! Thank you! :)

@rusmaxham
Copy link
Contributor

Fixed in the latest release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants