Skip to content

Conversation

@SamuelACook
Copy link
Contributor

@SamuelACook SamuelACook commented Aug 9, 2022

The deltaTime and WaitForSeconds get affected by the time scale
which can cause the overlay to never fade in or out when time scale
is set to approximately 0. Switching to unscaledDeltaTime and
WaitForSecondsRealtime will always fade in and out no matter
the time scale.

@thestonefox
Copy link
Member

This seems fine, but I'm wondering if it should be a public property bool to use deltaTime or unscaledDeltaTime, because technically this will cause a breaking change albeit that it is seen as a bug?

Is there any reason it could be deltaTime and therefore people already using this expect it to be deltaTime and this change could cause a break to their code?

If so then we should probably introduce a new bool like public bool UseUnscaledTime {} which is false by default so no breaking changes are included.

What do you think? if you think there should never be a case using Delta time then that's fine, we could also retro fix it later on if anyone complains of a break.

The deltaTime and WaitForSeconds gets effected by the time scale
which can cause the overlay to never fade in or out when timescale
is set to approximately 0. Switching to unscaledDeltaTime and
WaitForSecondsRealtime will always fade in and out no matter
the time scale.
@SamuelACook
Copy link
Contributor Author

I think for CameraColorOverlay its functionality use case would never require Delta time. I think this because we have properties to modify the duration of the blink, and modifying the time scale would essentially be doing that but forcing it. While time scale is used for many aspects of gameplay, blinks should always be representative of the duration properties. If someone is using time scale to manipulate the duration of the blink they can achieve this effect by modifying the duration properties based on the time scale. This change should not break functionality but just adjust the duration of the blink if time scale is being used.

I made appended changes to the commit that I missed in the first pull request. I had to update the WaitForSeconds to WaitForSecondsRealtime.

@SamuelACook SamuelACook changed the title fix(CameraOverlay): change deltaTime to unscaledDeltaTime Aug 10, 2022
@thestonefox thestonefox merged commit 306652c into ExtendRealityLtd:master Feb 8, 2023
@ExtendReality-Bot
Copy link
Member

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants