Gvr-unity-sdk: Controller not working when Time.timeScale = 0

Created on 16 Aug 2017  路  7Comments  路  Source: googlevr/gvr-unity-sdk

Few days ago I posted a thread about this bug. It's about the controller not working properly when Time.timeScale is set to 0. The controller isn't visible if Time.timeScale i 0 from the start, it doesn't interact with UI and tooltips are invisible. I managed to fix this by making following changes:
In GvrLaserVisual.cs replace
return lerpSpeed > 0.0f ? lerpSpeed * Time.deltaTime : 1.0f;
with
return lerpSpeed > 0.0f ? lerpSpeed * Time.unscaledDeltaTime : 1.0f;
In GvrControllerVisual.cs replace
float deltaTime = Time.deltaTime;
with
float deltaTime = Time.unscaledDeltaTime;
and in GvrArmModel.cs replace
float animationDelta = DELTA_ALPHA * Time.deltaTime;
with
float animationDelta = DELTA_ALPHA * Time.unscaledDeltaTime;

bug fixed in upcoming release

All 7 comments

Great suggestion. We're integrating something like this now.

Addressed in v1.100.0

Has this been fixed? I still have a similar problem with Google Cardboard game using Unity 2018.2 and Google VR for Unity 1.150.0. When Time.timeScale is set to 0 the reticle pointer disappears.

Could you try replacing instances of Time.deltaTime in GvrReticlePointer.cs with Time.unscaledDeltaTime and see if that addresses your issue?

@rusmaxham, thank you a lot, the solution works perfectly!

Good to know. We'll get this fixed in the next release.

This is now fixed in v1.170.

Was this page helpful?
0 / 5 - 0 ratings