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

Controller not working when Time.timeScale = 0 #690

Closed
wojwen opened this issue Aug 16, 2017 · 7 comments
Closed

Controller not working when Time.timeScale = 0 #690

wojwen opened this issue Aug 16, 2017 · 7 comments

Comments

@wojwen
Copy link

wojwen commented Aug 16, 2017

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;

@rusmaxham
Copy link
Contributor

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

@fredsa fredsa added the bug label Aug 23, 2017
@dsternfeld7
Copy link

Addressed in v1.100.0

@terreb
Copy link

terreb commented Aug 12, 2018

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.

@rusmaxham
Copy link
Contributor

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

@terreb
Copy link

terreb commented Aug 15, 2018

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

@rusmaxham rusmaxham reopened this Aug 15, 2018
@rusmaxham
Copy link
Contributor

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

@rusmaxham
Copy link
Contributor

This is now fixed in v1.170.

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

5 participants