You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a race condition but with the "EnsureCameraRig" function when it is run in the editor, the reason being that the "ServiceFramework.Initialise" method is executed on the background thread.
However, this requires a query to the active scene which is only possible on the UI thread, so when it queries for CameraCache.Main, it always returns a brand new Camera (because Unity....)
Reality Collective - Reality Toolkit Bug Report
Describe the bug
There is a race condition but with the "EnsureCameraRig" function when it is run in the editor, the reason being that the "ServiceFramework.Initialise" method is executed on the background thread.
However, this requires a query to the active scene which is only possible on the UI thread, so when it queries for CameraCache.Main, it always returns a brand new Camera (because Unity....)
The Log to state it has been recreated is currently omitted in the log for the editor to prevent confusion.
https://github.com/realitycollective/com.realitytoolkit.core/blob/108eeb76c7cb801bbe210eb9dca8e7bfdc5b098f/Runtime/CameraSystem/Providers/BaseCameraDataProvider.cs#L283
To Reproduce
Expected behavior
If the Camera code runs on teh UI thready, the issue should not occur
Actual behavior
Because the code is executed on the background thread, the XRCameraRig is always recreated.
The text was updated successfully, but these errors were encountered: