so I step into the “push button” prefab, I find out, it is this file: “XRPokeFollowAffordance.cs”. But in the scene, the push button can not find this file, though this file existed in the path. When I try to add the file, it popup the error:
Can’t add script
Can’t add script component ‘XRPokeFollowAffordance’ because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.
So, why??? The console also didn’t show me any error in this script. Do you have also the same problem like me? Is it a bug?
You should try closing the editor, opening the library folder in your project on the file explorer. Then find the package cache, and finally delete that folder.
I started a new project, then everything works fine. I guess, why this happens, maybe I follow the unity vr development tutorial on the learn.unity.com. I start the project from template Create-with-VR_2022LTS, then added another package VR-Pathway_Escape-Room_Assets.unitypackage, the xr interaction toolkit plugin and startassets is outdated, then I updated and reimported them from package manager window. So maybe this cause the conflict between the old version and new version in the cache. I have no idea, is it the real reason, I can currently not reproduce it. But this is what I guess. Anyway, if I start a new project, everything is fine at moment…
I don’t think, this problem should as solved mark, because, give up the project, which people have worked a lot on, is not a gut solution…
As I make a new project with the course supplied VR Template and the package VR-Pathway_Escape-Room_Assets.unitypackage, the first time everything works fine.
But after I close it and open it some times late, the same mysterious problem happened again. The unity editor can not find this script again.
So I guess is there maybe some conflict happens between the course templates and the xr interaction toolkit package during the update process.
Now, I only delete the library cache is not enough, so I only left the three folders “Assets”, “Packages” and “ProjectSettings” exist and delete all other files. Restart, then everything works fine. I am not sure, whether this mysterious problem will happen again, I will just continue to test.