Open lz7cjc opened 1 year ago
Hi
Make a new project following the steps in the Quickstart guide first. Before upgrading existing projects. To see how it all works, and if you get the expected result, and performance.
There are also some common tips in this thread https://github.com/googlevr/cardboard/issues/140.
thanks - but that is exactly what I did. The process I tried to follow:
Result: Project is an absolute mess. Far too many issues to document here
When I try to retrofit the sdk into upgradedUnityProject2022.3.1.0f1
using the Settings as per quickstart tutorial I am unable to do this
XR Plug-in Management Settings
Navigate to Project Settings > XR Plug-in Management.
Select Cardboard XR Plugin under Plug-in Providers. clicking the checkbox does nothing - I can't select it which is presumably why i get these errors:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// So I think I need to know how to install the sdk into the upgradedUnityProject2022.3.1.0f1, removing the old Cardboard SDK resulting in a clean install Unless you have a better idea - i don't really mind the process, I just want to be able to open my project in v2022 without errors as I can do when opening it in v2019 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I hope this is clear but please let me know if you need anything clarified, otherwise i look forward to a solution :)
These are the errors I get in upgradedUnityProject2022.3.1.0f1 presumably because i can't check that Google Cardboard option in XR plug in management settings
Errors:
We were unable to create an instance of the requested type
Google.XR.Cardboard.XRLoader. Please make sure that all packages are
updated to support this version of XR Plug-In Management. See the Unity
documentation for XR Plug-In Management for information on resolving
this issue.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat
(UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
UnityEditor.XR.Management.EditorUtilities:CreateScriptableObjectInstance
(string,string) (at
.@./Editor/EditorUtilities.cs:113)
UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeLoaderFromMetadata
(string,System.Collections.Generic.List`1
(Filename: .@.***/Editor/EditorUtilities.cs Line: 113)
Error creating instance of loader Cardboard XR Plugin for package
Cardboard XR Plugin
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat
(UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeLoaderFromMetadata
(string,System.Collections.Generic.List`1
(Filename: .@.***/Editor/XRPackageInitialization.cs Line: 149)
Instance of Unity.XR.MockHMD.MockHMDLoader couldn't be created because
there is no script with that name.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.ScriptableObject:CreateInstance (string)
UnityEditor.XR.Management.EditorUtilities:CreateScriptableObjectInstance
(string,string) (at
.@./Editor/EditorUtilities.cs:100)
UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeLoaderFromMetadata
(string,System.Collections.Generic.List`1
@.***/Editor/EditorUtilities.cs line 100]
We were unable to create an instance of the requested type
Unity.XR.MockHMD.MockHMDLoader. Please make sure that all packages are
updated to support this version of XR Plug-In Management. See the Unity
documentation for XR Plug-In Management for information on resolving
this issue.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat
(UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
UnityEditor.XR.Management.EditorUtilities:CreateScriptableObjectInstance
(string,string) (at
.@./Editor/EditorUtilities.cs:113)
UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeLoaderFromMetadata
(string,System.Collections.Generic.List`1
(Filename: .@.***/Editor/EditorUtilities.cs Line: 113)
Error creating instance of loader Mock HMD Loader for package MockHMD XR
Plugin
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:LogFormat
(UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeLoaderFromMetadata
(string,System.Collections.Generic.List`1
(Filename: .@.***/Editor/XRPackageInitialization.cs Line: 149)
Instance of Unity.XR.MockHMD.MockHMDBuildSettings couldn't be created because there is no script with that name. UnityEngine.StackTraceUtility:ExtractStackTrace () UnityEngine.ScriptableObject:CreateInstance (string) UnityEditor.XR.Management.EditorUtilities:CreateScriptableObjectInstance (string,string) (at .@./Editor/EditorUtilities.cs:100) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeSettingsFromMetadata (UnityEditor.XR.Management.Metadata.IXRPackage,string,string) (at .@./Editor/XRPackageInitialization.cs:175) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializePackageFromMetadata (UnityEditor.XR.Management.Metadata.IXRPackage,UnityEditor.XR.Management.Metadata.IXRPackageMetadata) (at .@./Editor/XRPackageInitialization.cs:122) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitPackage (UnityEditor.XR.Management.Metadata.IXRPackage) (at .@./Editor/XRPackageInitialization.cs:110) UnityEditor.XR.Management.XRPackageInitializationBootstrap:BeginPackageInitialization () (at .@./Editor/XRPackageInitialization.cs:79) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:get_packages () (at .@./Editor/Metadata/XRPackageMetadataStore.cs:137) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:UpdateInstallablePackages () (at .@.***/Editor/Metadata/XRPackageMetadataStore.cs:571) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
@.***/Editor/EditorUtilities.cs line 100]
We were unable to create an instance of the requested type Unity.XR.MockHMD.MockHMDBuildSettings. Please make sure that all packages are updated to support this version of XR Plug-In Management. See the Unity documentation for XR Plug-In Management for information on resolving this issue. UnityEngine.StackTraceUtility:ExtractStackTrace () UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) UnityEngine.Logger:Log (UnityEngine.LogType,object) UnityEngine.Debug:LogError (object) UnityEditor.XR.Management.EditorUtilities:CreateScriptableObjectInstance (string,string) (at .@./Editor/EditorUtilities.cs:113) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializeSettingsFromMetadata (UnityEditor.XR.Management.Metadata.IXRPackage,string,string) (at .@./Editor/XRPackageInitialization.cs:175) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitializePackageFromMetadata (UnityEditor.XR.Management.Metadata.IXRPackage,UnityEditor.XR.Management.Metadata.IXRPackageMetadata) (at .@./Editor/XRPackageInitialization.cs:122) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitPackage (UnityEditor.XR.Management.Metadata.IXRPackage) (at .@./Editor/XRPackageInitialization.cs:110) UnityEditor.XR.Management.XRPackageInitializationBootstrap:BeginPackageInitialization () (at .@./Editor/XRPackageInitialization.cs:79) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:get_packages () (at .@./Editor/Metadata/XRPackageMetadataStore.cs:137) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:UpdateInstallablePackages () (at .@.***/Editor/Metadata/XRPackageMetadataStore.cs:571) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
(Filename: .@.***/Editor/EditorUtilities.cs Line: 113)
MockHMD XR Plugin package Initialization not completed. You will need to create any instances of the loaders and settings manually before you can use the intended XR Plug-in Package. UnityEngine.StackTraceUtility:ExtractStackTrace () UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) UnityEngine.Logger:Log (UnityEngine.LogType,object) UnityEngine.Debug:LogWarning (object) UnityEditor.XR.Management.XRPackageInitializationBootstrap:InitPackage (UnityEditor.XR.Management.Metadata.IXRPackage) (at .@./Editor/XRPackageInitialization.cs:112) UnityEditor.XR.Management.XRPackageInitializationBootstrap:BeginPackageInitialization () (at .@./Editor/XRPackageInitialization.cs:79) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:get_packages () (at .@./Editor/Metadata/XRPackageMetadataStore.cs:137) UnityEditor.XR.Management.Metadata.XRPackageMetadataStore:UpdateInstallablePackages () (at .@./Editor/Metadata/XRPackageMetadataStore.cs:571) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
(Filename: .@.***/Editor/XRPackageInitialization.cs Line: 112)
[Licensing::Client] Successfully updated the access token [Licensing::Module] Successfully updated access token: "sMegGKE7"... (expires: 2024-10-10 12:21:05 GMT) [Licensing::Client] Successfully updated the access token [Licensing::Module] Successfully updated access token: "sMegGKE7"... (expires: 2024-10-10 12:21:06 GMT) Android Extension - Scanning For ADB Devices 242 ms [collab-accelerator] discovery started due to a new cloud project binding UPID Received 'd440f56b-e1bd-4217-836f-306dd3a94e2d'. Attempted to call .Dispose on an already disposed CancellationTokenSource Android Extension - Scanning For ADB Devices 270 ms Android Extension - Scanning For ADB Devices 211 ms UPID Received 'd440f56b-e1bd-4217-836f-306dd3a94e2d'.
Thanks but that's kind of what I'm asking you! What should I be looking for? Is there a definitive list? Does it matter what order I remove and add? The quickstart is great for a new project but I can't be the only one wishing you upgrade an existing project and I certainly could do with a guide for thisGet Outlook for Android
FYI when i search for GVR in the project I get zero results
and searching for Google just brings up the sample folder and a couple of images
GvrReticlePointer
------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Author" @.> Sent: 13/10/2023 03:29:11 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Perhaps the list of errors is even longer?
You have remove all references to the old built in Google VR SDK first, like GvrReticlePointer, which isn't available any more. Then you have to manually implement the new open source Cardboard SDK as described in the quick start. Maybe there are even other outdated packages, and code references in the project, throwing errors which needs attention?
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1760974289, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN573MDUKTRMXDZOQADX7DNTPANCNFSM6AAAAAA5YWMJ5U. You are receiving this because you authored the thread.Message ID: @.***>
The Cardboard XR module only works in the build. Not in Editor Mode. You can use Conditional Compilation to don't load Google.XR.Cardboard.XRLoader when running in the Editor.
Enclose those parts in a _#if !UNITYEDITOR ... #endif block.
Then for example just use the inspector to turn the camera, to simulate a player looking around, when testing the app in the Editor.
thanks for getting back to me That seems to have cleared the problem but it has uncovered two more: can you help with the following?
thanks
------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Author" @.> Sent: 15/10/2023 01:35:16 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
The Cardboard XR module only works in the build. Not in Editor Mode. You can use Conditional Compilation to don't load Google.XR.Cardboard.XRLoader when running in the Editor.
Enclose those parts with in a #if !UNITY_EDITOR ... #endif block.
Then for example just use the inspector to turn the camera, to simulate a player looking around, when testing the app in the Editor.
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1763269194, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN6IUQJMI6R67IBMRFLX7NRYJANCNFSM6AAAAAA5YWMJ5U. You are receiving this because you authored the thread.Message ID: @.***>
Maybe hit.distance can be used to determine if the interactable item is close enough to interact with?
Ok and how about this error : SendMessage OnPointerEnter has no receiver!UnityEngine.GameObject:SendMessage (string)CardboardReticlePointer:Update () (at .@./Runtime/CardboardReticlePointer.cs:158)- how do i fix?Get Outlook for AndroidFrom: Mandelbrow @.>Sent: Sunday, October 15, 2023 2:17:14 PMTo: googlevr/cardboard @.>Cc: lz7cjc @.>; Author @.***>Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437) Maybe hit.distance can be used to determine if the interactable item is close enough to interact with?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
yes thank you - we all know how to use Google My question is, since upgrading i am getting these error messages where i didn't before. What is the cause of this and how do i fix this specific problem, not one relating to firing rockets at enemies
------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Author" @.> Sent: 16/10/2023 00:37:41 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1763674681, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN63OE5AXLCSVF5KFITX7STYLANCNFSM6AAAAAA5YWMJ5U. You are receiving this because you authored the thread.Message ID: @.***>
that documentation is hard to fathom is this functionality that has been removed from the upgrade? It used to be so simple - set up a collider, set the reticle distance, trigger the script when passing through the collider - i am asking how i replicate that simple workflow without having to rewrite multiple scripts
------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Author" @.> Sent: 15/10/2023 14:17:09 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Maybe hit.distance https://docs.unity3d.com/ScriptReference/RaycastHit-distance.html can be used to determine if the interactable item is close enough to interact with?
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1763451795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN7X6LMNQKDIKQJ5AG3X7QLBLANCNFSM6AAAAAA5YWMJ5U. You are receiving this because you authored the thread.Message ID: @.***>
@lz7cjc You have to read what Google found for you too. The error means you are sending the command to an object which can't receive it. Perhaps the ray is hitting other objects in the scene? Debug.Log(hit.collider.name); could possibly tell if that's the case.
And, does this error really break the code?
thanks unfortunately i am not a very good developer and have hacked together my code without necessarily understanding what is going on. Will give it another go based on these insights ------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 16/10/2023 11:14:46 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
@lz7cjc https://github.com/lz7cjc You have to read what Google found for you too. The error means you are sending the command to an object which can't receive it. Perhaps the ray is hitting other objects in the scene? Debug.Log(hit.collider.name); could possibly tell if that's the case.
And, does this error really break the code?
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1764576402, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKNY5RRPL3RDNI3UD4OLX7U6NNAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRUGU3TMNBQGI. You are receiving this because you were mentioned.Message ID: @.***>
Thanks @lz7cjc for reaching out to us. And sorry for the long delay!
Unfortunately there is no guide to migrate from GVR to the Cardboard XR Plugin. It is part of our backlog and will be prioritized among other tickets.
What is the state of the migration? If you share a copy of your project I will take a look to figure out what is missing.
Thanks!
thanks for the offer Ari I have reverted to 2019 as it was a complete mess... so will need to do a new upgrade. Once I have done this, what is the best way to share the project with you?
------ Original Message ------ From: "Ari" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 26/10/2023 12:14:02 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Thanks @lz7cjc https://github.com/lz7cjc for reaching out to us. And sorry for the long delay!
Unfortunately there is no guide to migrate from GVR to the Cardboard XR Plugin. It is part of our backlog and will be prioritized among other tickets.
What is the state of the migration? If you share a copy of your project I will take a look to figure out what is missing.
Thanks!
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1781328885, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN6UABE2GNFVE5QTIWDYBJ43VAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGMZDQOBYGU. You are receiving this because you were mentioned.Message ID: @.***>
Given that your project is currently using Unity 2019, you may try start the migration using Cardboard v1.16. That is the last Cardboard version that supported Unity 2019.4.
Once you make the migration work with Unity 2019.4, you can try upgrading the Unity version and use Cardboard v1.22.
About sharing you project, you can share a zip with your Unity project , a link to a Github repo or a drive link. That is up to you.
Hi not being able to use with 2019 is a real problem for an internal project we have (2019 because of Unity big). What changed after v1.16 that means Unity 2019 is no longer supported? Edit: BTW on iOS you can actually use the latest plugin with 2019 & later no problem. On android I am not clear on the problem (own project crashes at startup)
thanks but I am already using with
wouldn't that be a downgrade?
What is the correct process? Do I upgrade Google Cardboard whilst in V2019 or do I first upgrade the project to V2022 and then try to upgrade Cardboad?
NB When i try to do the latter i get the errors previously reported
If you can help me define the process to upgrade my VR project from 2019 to 2022 it would be very much appreciated
thanks
------ Original Message ------ From: "Ari" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 27/10/2023 11:39:44 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Given that your project is currently using Unity 2019, you may try start the migration using Cardboard v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0. That is the last Cardboard version that supported Unity 2019.4.
Once you make the migration work with Unity 2019.4, you can try upgrading the Unity version and use Cardboard v1.22.
About sharing you project, you can share a zip with your Unity project , a link to a Github repo or a drive link. That is up to you.
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1783031576, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKN6EHT5BXMXXY55GXITYBPBTBAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTGAZTCNJXGY. You are receiving this because you were mentioned.Message ID: @.***>
@andypoly given that your comment is not related to the migration from GVR to the Cardboard SDK please create another issue with your concern so as to keep the topic of this conversation.
@lz7cjc As you said, given that your project is currently using GVR, I would expect that upgrading your project to Unity 2022 would cause many error messages.
My proposal is to follow these steps:
Assets/Plugins/Android/mainTemplate.gradle
are different for this version: implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
Feel free to ask any other question you might have about this topic. Thanks!
Thanks but I believe I am using the XR plugin . However I use gvr since there seems to be no way to control the scene when running in the editor without it. Further I don't want to use the interactive layer. To avoid a rewrite I want to use event triggers, colliders and reticle pointer set to distance XAnd I can't find any documentation around thisThanksGet Outlook for Android
In the hope I getting this resolved I have tried to consolidate everything into this single response:
My objective To upgrade to v2020+ of Unity Editor so I can build an apk that is compliant with Google Console policies re Android API 31.
here is the list of issues i have (it is probably worth reading through all of them first as they all seem to be interconnected): 1 You suggest I Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. I currently have a GoogleVR folder XR plugin folder Question: Do I need to uninstall/delete/remove anything from my project before doing this or after? What is the best way to do this? Please bear in mind I am using GVR reticle pointer as a main stalwart of my project (see #3)
2 When i install v1.16 there is no CardboardReticlePointer object attached to the camera in the sample scene or indeed in the project Question: How do I fix this?
to Assigning objects to interactive layer and losing the ability to only have objects live when within a defined distance of the reticle pointer I would really prefer to avoid having to completely rewrite the game with less functionality than i already have Question: How do I use my existing code and processes with the new SDK
Can't control the game when running in the Editor Question: How do I control the game and test it when running in the editor i.e. without having to build a new apk every time i want to check something
It seems that main issue i have when upgrading to a later version of Unity Editor is that I get a lot of errors around Daydream in some of the scripts For example EditorHeadsetProvider.cs. . It would seem the simplest option would be to remove these references. Question: Can you help me remove references to Daydream? Would this help me meet my objective?
Finally it is worth noting that i am very happy with the way the game works; it isn't sophisticated and the way i have it set up currently does the job. So I am just looking for a way to get my latest release up onto Google Play with the least risk and effort
thanks
------ Original Message ------ From: "Ari" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 02/11/2023 14:24:34 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
@andypoly https://github.com/andypoly given that your comment is not related to the migration from GVR to the Cardboard SDK please create another issue with your concern so as to keep the topic of this conversation.
@lz7cjc https://github.com/lz7cjc As you said, given that your project is currently using GVR, I would expect that upgrading your project to Unity 2022 would cause many error messages.
My proposal is to follow these steps:
Preparation for migration: Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. This will allow you to be sure that you can run this version of the Cardboard XR Plugin and will prevent some possible errors when making the migration.Note:* Take into account that the dependencies to add in Assets/Plugins/Android/mainTemplate.gradle are different for this version: implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.gms:play-services-vision:20.1.3' implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
Migrate your project from using GVR to use Cardboard XR Plugin https://github.com/googlevr/cardboard-xr-plugin with Unity 2019.4. For this you will have to use Cardboard v1.16. As you said, this would be a downgrade but it is only to make the migration easier for you, in the next step you will upgrade it again.If you can get this done, then upgrading to 2022 should be easy.Upgrade your project (Now integrated with Cardboard XR Plugin) to Unity 2022.3. Now you will be able to use the last version of the Cardboard XR Plugin. Which at the moment is v1.22. Feel free to ask any other question you might have about this topic. Thanks!
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1791188335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKNYLMOX6NTRZYYXWPYDYCPJNFAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRGE4DQMZTGU. You are receiving this because you were mentioned.Message ID: @.***>
Hi I have had some success and narrowed things down to two issues.
However my project sets event triggers in the Editor but doing this results in these errors SendMessage OnPointerEnter has no receiver! UnityEngine.GameObject:SendMessage (string) CardboardReticlePointer:Update () (at .@.***/Runtime/CardboardReticlePointer.cs:158)
SendMessage OnPointerExit has no receiver! UnityEngine.GameObject:SendMessage (string) CardboardReticlePointer:Update () (at .@.***/Runtime/CardboardReticlePointer.cs:156)
Whenever my reticle pointer moves over any object with this set up How do I continue to use my set up since I have hundreds of these objects and really don't want to convert them all to working with code
Please can you get back to me with how to resolve these issues
thanks
------ Original Message ------ From: "Nick Abelson" @.> To: "googlevr/cardboard" @.> Sent: 03/11/2023 09:38:09 Subject: Re[2]: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
In the hope I getting this resolved I have tried to consolidate everything into this single response:
My objective To upgrade to v2020+ of Unity Editor so I can build an apk that is compliant with Google Console policies re Android API 31.
here is the list of issues i have (it is probably worth reading through all of them first as they all seem to be interconnected): 1 You suggest I Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. I currently have a GoogleVR folder XR plugin folder Question: Do I need to uninstall/delete/remove anything from my project before doing this or after? What is the best way to do this? Please bear in mind I am using GVR reticle pointer as a main stalwart of my project (see #3)
2 When i install v1.16 there is no CardboardReticlePointer object attached to the camera in the sample scene or indeed in the project Question: How do I fix this?
- Based on my understanding of the quick install guide I am going to have to change the way a user interacts with my game. If this is the case, I am basically going to have to rewrite the entire game, something that I really don't want to do From Collider+Event Trigger+Reticle Pointer Distance+Script No intersection or else too far away - no selection: Intersection and in range results in selection
to Assigning objects to interactive layer and losing the ability to only have objects live when within a defined distance of the reticle pointer I would really prefer to avoid having to completely rewrite the game with less functionality than i already have Question: How do I use my existing code and processes with the new SDK
Can't control the game when running in the Editor Question: How do I control the game and test it when running in the editor i.e. without having to build a new apk every time i want to check something
It seems that main issue i have when upgrading to a later version of Unity Editor is that I get a lot of errors around Daydream in some of the scripts For example EditorHeadsetProvider.cs. . It would seem the simplest option would be to remove these references. Question: Can you help me remove references to Daydream? Would this help me meet my objective?
Finally it is worth noting that i am very happy with the way the game works; it isn't sophisticated and the way i have it set up currently does the job. So I am just looking for a way to get my latest release up onto Google Play with the least risk and effort
thanks
------ Original Message ------ From: "Ari" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 02/11/2023 14:24:34 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
@andypoly https://github.com/andypoly given that your comment is not related to the migration from GVR to the Cardboard SDK please create another issue with your concern so as to keep the topic of this conversation.
@lz7cjc https://github.com/lz7cjc As you said, given that your project is currently using GVR, I would expect that upgrading your project to Unity 2022 would cause many error messages.
My proposal is to follow these steps:
Preparation for migration: Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. This will allow you to be sure that you can run this version of the Cardboard XR Plugin and will prevent some possible errors when making the migration.Note:* Take into account that the dependencies to add in Assets/Plugins/Android/mainTemplate.gradle are different for this version: implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.gms:play-services-vision:20.1.3' implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
Migrate your project from using GVR to use Cardboard XR Plugin https://github.com/googlevr/cardboard-xr-plugin with Unity 2019.4. For this you will have to use Cardboard v1.16. As you said, this would be a downgrade but it is only to make the migration easier for you, in the next step you will upgrade it again.If you can get this done, then upgrading to 2022 should be easy.Upgrade your project (Now integrated with Cardboard XR Plugin) to Unity 2022.3. Now you will be able to use the last version of the Cardboard XR Plugin. Which at the moment is v1.22. Feel free to ask any other question you might have about this topic. Thanks!
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1791188335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKNYLMOX6NTRZYYXWPYDYCPJNFAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRGE4DQMZTGU. You are receiving this because you were mentioned.Message ID: @.***>
Hi please can you get back to me - it is vital I have a solution to this. The overarching conceptual problem is that based on my current knowledge I can't limit the reach of the reticle pointer. Any object assigned to the interactive layer will interact if the reticle pointer passes over it. I am assuming this is a gap in my knowledge since this would make building any virtual explorable world impossible so please can you help me understand how to set up the limits and ideally do away with the need to set objects to the interactive layer which is going to be a huge amount of work.
After experimenting with my scene, I need to know the rules for where you can put an interactive layer in the hierarchy. I couldn't understand why some of my objects worked and others didn't. So I set up simple test object "TestObject" with a debug script and found the following script: using UnityEngine;
publicclassprintToScreen : MonoBehaviour { publicvoid OnPointerEnter() { Debug.Log("ppp pointer enter debug");
} publicvoid OnPointerExit() { Debug.Log("ppp pointer exit debug"); } }
This works:
This doesn't
This is important since my HUD needs to be within my player objects to ensure it moves with the camera - as things stand it doesn't work. I get the reticle pointer changing from a point to a circle but it doesn't execute the script
I still need to understand how to set up event triggers as components in the editor as opposed to in code as set out below
thanks
------ Original Message ------ From: "Nick Abelson" @.> To: "googlevr/cardboard" @.> Sent: 10/11/2023 10:15:04 Subject: Re[3]: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Hi I have had some success and narrowed things down to two issues.
- The start up tutorial only covers using publicvoid OnPointerEnter() publicvoid OnPointerExit() in code
However my project sets event triggers in the Editor but doing this results in these errors SendMessage OnPointerEnter has no receiver! UnityEngine.GameObject:SendMessage (string) CardboardReticlePointer:Update () (at .@.***/Runtime/CardboardReticlePointer.cs:158)
SendMessage OnPointerExit has no receiver! UnityEngine.GameObject:SendMessage (string) CardboardReticlePointer:Update () (at .@.***/Runtime/CardboardReticlePointer.cs:156)
Whenever my reticle pointer moves over any object with this set up How do I continue to use my set up since I have hundreds of these objects and really don't want to convert them all to working with code
- How do I set the max reticle distance - I need to ensure that users can only interact with active objects if they are "close" otherwise things are going to get very confusing in my world
Please can you get back to me with how to resolve these issues
thanks
------ Original Message ------ From: "Nick Abelson" @.> To: "googlevr/cardboard" @.> Sent: 03/11/2023 09:38:09 Subject: Re[2]: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
In the hope I getting this resolved I have tried to consolidate everything into this single response:
My objective To upgrade to v2020+ of Unity Editor so I can build an apk that is compliant with Google Console policies re Android API 31.
here is the list of issues i have (it is probably worth reading through all of them first as they all seem to be interconnected): 1 You suggest I Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. I currently have a GoogleVR folder XR plugin folder Question: Do I need to uninstall/delete/remove anything from my project before doing this or after? What is the best way to do this? Please bear in mind I am using GVR reticle pointer as a main stalwart of my project (see #3)
2 When i install v1.16 there is no CardboardReticlePointer object attached to the camera in the sample scene or indeed in the project Question: How do I fix this?
- Based on my understanding of the quick install guide I am going to have to change the way a user interacts with my game. If this is the case, I am basically going to have to rewrite the entire game, something that I really don't want to do From Collider+Event Trigger+Reticle Pointer Distance+Script No intersection or else too far away - no selection: Intersection and in range results in selection
to Assigning objects to interactive layer and losing the ability to only have objects live when within a defined distance of the reticle pointer I would really prefer to avoid having to completely rewrite the game with less functionality than i already have Question: How do I use my existing code and processes with the new SDK
Can't control the game when running in the Editor Question: How do I control the game and test it when running in the editor i.e. without having to build a new apk every time i want to check something
It seems that main issue i have when upgrading to a later version of Unity Editor is that I get a lot of errors around Daydream in some of the scripts For example EditorHeadsetProvider.cs. . It would seem the simplest option would be to remove these references. Question: Can you help me remove references to Daydream? Would this help me meet my objective?
Finally it is worth noting that i am very happy with the way the game works; it isn't sophisticated and the way i have it set up currently does the job. So I am just looking for a way to get my latest release up onto Google Play with the least risk and effort
thanks
------ Original Message ------ From: "Ari" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 02/11/2023 14:24:34 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
@andypoly https://github.com/andypoly given that your comment is not related to the migration from GVR to the Cardboard SDK please create another issue with your concern so as to keep the topic of this conversation.
@lz7cjc https://github.com/lz7cjc As you said, given that your project is currently using GVR, I would expect that upgrading your project to Unity 2022 would cause many error messages.
My proposal is to follow these steps:
Preparation for migration: Try Running the Cardboard XR Plugin v1.16 https://github.com/googlevr/cardboard-xr-plugin/releases/tag/v1.16.0 sample on Unity 2019.4 by following the Quickstart https://developers.google.com/cardboard/develop/unity/quickstart. This will allow you to be sure that you can run this version of the Cardboard XR Plugin and will prevent some possible errors when making the migration.Note:* Take into account that the dependencies to add in Assets/Plugins/Android/mainTemplate.gradle are different for this version: implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.gms:play-services-vision:20.1.3' implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
Migrate your project from using GVR to use Cardboard XR Plugin https://github.com/googlevr/cardboard-xr-plugin with Unity 2019.4. For this you will have to use Cardboard v1.16. As you said, this would be a downgrade but it is only to make the migration easier for you, in the next step you will upgrade it again.If you can get this done, then upgrading to 2022 should be easy.Upgrade your project (Now integrated with Cardboard XR Plugin) to Unity 2022.3. Now you will be able to use the last version of the Cardboard XR Plugin. Which at the moment is v1.22. Feel free to ask any other question you might have about this topic. Thanks!
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1791188335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKNYLMOX6NTRZYYXWPYDYCPJNFAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJRGE4DQMZTGU. You are receiving this because you were mentioned.Message ID: @.***>
@lz7cjc Do you really need Event Triggers for the UI elements? As the reticle sends messages to the GameObject the ray hits, there should be enough with scripts with corresponding method names to act on the incoming messages.
https://docs.unity3d.com/ScriptReference/GameObject.SendMessage.html Description Calls the method named methodName on every MonoBehaviour in this GameObject.
Thanks for getting back to meIt's not that I need them, more that I already have them... On hundreds of objects. Further if I have to use layers I have got to change that setting on each of those objects as well. And without using reticle pointer distance I lose the granularity of control over what is active and when (at least that is my understanding of my predicament)The problem I need to resolve is that the upgrade from Google vr to cardboard sdk plugin has changed the way this all works and I want to stick withReticle pointer distance + box collider+event trigger components to trigger my script. This will avoid having to implement a load of changes and subsequent testingThanksGet Outlook for Android
Hi I opened this ticket over 6 weeks ago (and not received a response from last post for 5 days). So for more than 6 weeks my project has been in limbo. Please can we get to a conclusion To summarise where we are at:
This results in the following issues which mean I can't launch an updated app which is massively overdue
NB I have up until now been replying in email and looking at this thread is appears that none of the associated images have uploaded - so here are the key ones: Reticle distance property - this restricts interaction with objects to those that "close" and deactivates anything in the distance
Interactive layer not working as object sits inside my player object
Interactive layer working as object sits outside my player object
How my legacy system is set up to work with reticle pointer and event trigger components + scripts - it is this same functionality i wish to replicate with the upgrade
Please, can we get to the point where I have some solutions to implement so we can close this ticket. thanks
Perhaps there are something going on with the event system. This post mention a custom Input Module for the Event system to respond to Gaze inputs https://github.com/googlevr/cardboard/issues/121#issuecomment-703626026
thanks for the link this, together with the follow on links from that page do seem to describe the issues I am experiencing but unfortunately it doesn't get me any further down the line this link: http://talesfromtherift.com/vr-gaze-input/ looks interesting but hard to follow. For example where does this code go? void SetCrossHairAtDistance(float dist) { // Move the crosshair forward to the new distance Vector3 position = Crosshair.localPosition; Crosshair.localPosition = new Vector3 (position.x, position.y, dist); // But keep the crosshair the same perceptable size no matter the distance Crosshair.localScale = CrosshairOriginalScale * dist; } So I downloaded the scripts at the bottom of the page but they throw up an error when i import them GazeInputModuleCrosshair.cs(51,32): error CS1061: 'GazeInputModule' does not contain a definition for 'CurrentRaycast' and no accessible extension method 'CurrentRaycast' accepting a first argument of type 'GazeInputModule' could be found (are you missing a using directive or an assembly reference?)
Looking at the comments this page appears to go back to 2015 so presumably very out of date - therefore I am wondering what in that post made you think it would be helpful? Can you be a little more specific?
I then looked to follow the links and this is where it led me:
broken link https://communityforums.atmeta.com/t5/errors/error404page#p285070 For Oculus - I am using Cardboard https://www.youtube.com/watch?v=LLKYbwNnKDg
This post suggests that the functionality would be merged back in March 23 https://github.com/googlevr/cardboard/issues/47
this looks the most promising https://github.com/googlevr/cardboard-xr-plugin/pull/13 https://github.com/JoaoBorks/cardboard-xr-plugin#feature/xr_interaction
but the original post is from 2020 - since this is a fork has it now been merged with the master? When I try to install the package from https://github.com/JoaoBorks/cardboard-xr-plugin.git#feature/xr_interaction I get the message that "please wait, installing package" for ten minutes before I give up. Presumably because it no longer exists - so how do i get the sample scenes which offer the functionality I require since they aren't in the master . So i tried downloading and installing from disk but get the same issue
Bottom line is that you had a really good thing going with the original GVR; simple to implement and robust. Now there is no clear way to replicate that after an upgrade. By forcing us to use apk v31+ to publish to Google Play (and hence upgrade to Unity 2020+ where the old GVR won't work) I am boxed in. GVR required very little coding skill. This new solution is complicated and seems to require a fair amount of unpicking and reshuffling and increased levels of skill to upgrade. I appreciate it might be simple to implement in a new project, although the lack of reticle distance seems to massively limit what you can achieve with it but that is irrelevant for those of us who already have a project developed for GVR
Surely the collective planet brains at Google can pull together the various threads, posts, code updates and advice into a set of simple easy to follow steps, with complete scripts that can be implemented for someone wanting to upgrade a live project from GVR to XR plugin
Please can you help me resolve this thanks
------ Original Message ------ From: "Mandelbrow" @.> To: "googlevr/cardboard" @.> Cc: "lz7cjc" @.>; "Mention" @.> Sent: 22/11/2023 10:12:22 Subject: Re: [googlevr/cardboard] Upgrading existing project to new cardboard SDK (Issue #437)
Perhaps there are something going on with the event system. This post mention a custom Input Module for the Event system to respond to Gaze inputs #121 (comment) https://github.com/googlevr/cardboard/issues/121#issuecomment-703626026
— Reply to this email directly, view it on GitHub https://github.com/googlevr/cardboard/issues/437#issuecomment-1822746829, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWKNZG5VZ52KV5ITIH333YFX23NAVCNFSM6AAAAAA5YWMJ5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSG42DMOBSHE. You are receiving this because you were mentioned.Message ID: @.***>
Yes that's the one I refer to at the start of this post together with the problems trying to follow it ... Not least that it appears to have been posted years ago and the scripts throw up errorsGet Outlook for Android
If you are fine with a sprite for a basic reticle. To give a visual on when its active, in which direction the player is looking and when it is interacting with a button, or other game object. What is not covered in these two tutorials?
Gaze Events: http://talesfromtherift.com/vr-gaze-input/
apologies i thought i explained this in the previous post but will repeat here:
Quoting from article you reference
_"Lets add a crosshair to the above. There is the awesome YouTube video Oculus Rift DK2 – Unity Tutorial: Reticle that goes into full details about how to create a VR crosshair.
I’ve based mine on a couple of lines of code posted by cybereality in the Oculus forums. The key part is to maintain correct stereoscopic depth and move the crosshair to the same distance as the object being looked at, but crucially keep the crosshair looking the same size to the player. This is handled by these lines:_
void SetCrossHairAtDistance(float dist) { // Move the crosshair forward to the new distance Vector3 position = Crosshair.localPosition; Crosshair.localPosition = new Vector3 (position.x, position.y, dist); // But keep the crosshair the same perceptable size no matter the distance Crosshair.localScale = CrosshairOriginalScale * dist; }
"
I can't see any instruction as to where that code snippet should be placed
as for the second link you provide which was in this post, it is for Oculus, not cardboard (the other link in the article is broken - New Unity UI + OVR Look-Based Input HOWTO)
I also mentioned that when I downloaded and imported the offered scripts on this post i got errors - which i included in my previous post GazeInputModuleCrosshair.cs(51,32): error CS1061: 'GazeInputModule' does not contain a definition for 'CurrentRaycast' and no accessible extension method 'CurrentRaycast' accepting a first argument of type 'GazeInputModule' could be found (are you missing a using directive or an assembly reference?)
I also pointed out that this is a post that has comments dating back to 2015 so I am wondering if this is relevant 8 years later when there is a completely different SDK ?
Based on these issues I haven't been able to make any progress with this article
Can I also ask about JoaoBorks contribution that i linked to above This seemed to get closest to resolving my problem but I can't find the sample scenes and again it seems quite old with suggestions that it has been merged into the master release (but I can't find anything corresponding to this)
We seem to be going around in circles. Am I being unreasonable to expect support for an app that will published on Google Play using Google Cardboard SDK for Unity? Should I just accept that all the work I have done over the last few years should now be thrown in the bin?
Quite frankly I am starting to panic Google has effectively killed off my project so please excuse any frustration that is creeping into my responses. I am getting desperate
I still don't understand why there is no clear upgrade path from GVR to the Cardboard SDK that doesn't involve a complete rebuild or having to filter through loads of different suggestions, all of which so far are dead ends.
All I want to do is implement gaze and pick for objects within a certain distance. Isn't that the most basic of requirements for developing for Google Cardboard where there might be no physical button and no hand controllers?
Is there anyone else who can offer some help @arilow
What make you believe a tutorial for placing, and scaling a sprite in the position av a Raycast hit.point isn't relevant after 8 years? The CameraPointer.cs in the HelloCardboard scene is already casting the ray.
the reason I assumed that was because Unity has changed significantly since 2015 so it would seem likely that this too has evolved. Obviously i was wrong so you can ignore that single comment as part of a far more ranging set of issues relating to that post. It does somewhat feel like you reply is missing the bigger picture
I have written in great detail about the problems I am experiencing. I am asking for help and you are not providing me with a workable solution - this is self defining since if i had a working solution i wouldn't be wasting your time or my own and i would be well on the way to publishing my app
You seem to think this is all very simple - so for someone without your experience, knowledge and big brain please can you provide the steps i need to take to upgrade from GVR to Google Cardboard SDK for Unity where i can restrict the working distance of the reticle pointer, using event triggers as components in the editor without the need to use an interact objective - i.e the standard way that GVR was previously implemented
then we can both move on with our lives
Hi I am trying to upgrade to Unity 2022.3 so that I can use the new SDK for google cardboard. My existing project is built in v2019
I have installed the latest SDK but not sure what to do with legacy code. Is there a How To guide for existing projects already using the older version and if not please can you confirm the steps?
I have tried creating a new project and copying over my project files from the original project but this results in 1000s of errors. Therefore I have just upgraded the project via Unity Hub and now need to retrofit the new version of the SDK.
These are a couple of the errors I am seeing Prefab instance problem. Missing Prefab Asset: 'GvrReticlePointer (Missing Prefab with guid: 60270cf52a5e94998a5a335989159738)' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) Instance of Google.XR.Cardboard.XRLoader couldn't be created because there is no script with that name. UnityEditor.EditorApplication:Internal_CallUpdateFunctions () We were unable to create an instance of the requested type Google.XR.Cardboard.XRLoader. Please make sure that all packages are updated to support this version of XR Plug-In Management. See the Unity documentation for XR Plug-In Management for information on resolving this issue. UnityEditor.EditorApplication:Internal_CallUpdateFunctions () Error creating instance of loader Cardboard XR Plugin for package Cardboard XR Plugin UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
I have installed Google Cardboard XR plugin 1.2.1.0
thanks for your help