When I load in the Oculus Utilities for Unity, I immediately have an error in one of the scripts which reads "Assets/Oculus/VR/Scripts/OVRPlugin.cs(2876,18): error CS0103: The name `OVRP_1_15_0' does not exist in the current context" How can I deal with this error? Is there a way to locate OVRP or is that no longer a part of the oculus utilities? Thank You!
Culprits are all in OVRPlugin.cs: #if !OVRPLUGIN_UNSUPPORTED_PLATFORM Roughly line 2948. This says "If not a supported platform, do not declare the OVRP_0_X_X classes".
#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || (UNITY_ANDROID && !UNITY_EDITOR)) #define OVRPLUGIN_UNSUPPORTED_PLATFORM #endif Line 22-24. These determine if you're on a supported platform or not. If Unity Android target while using the Unity Editor (Play Mode), this makes you in "not supported platform mode", and thus the OVRP_0_X_X classes have not been declared.
These were not #if'ed out properly, causing the errors. The fixes are all the same, but here's one sample. Add the Bold Italic lines like this around each set of offending code.
#if !OVRPLUGIN_UNSUPPORTED_PLATFORM if (version >= OVRP_1_15_0.version) { Result result = OVRP_1_15_0.ovrp_GetNodeFrustum2(nodeId, out frustum); if (result != Result.Success) { return false; } else { return true; } } else #endif { return false; }
Then your scripts should compile and back to dev'ing.
(these are the line numbers once they're added sequentially). Keep the #endif just after the "else", and then the subsequent "{ return false; }" block works very nicely. (as illustrated in my previous post)
@Zucchini_Fred hmm no, best advice I’d say is check to make sure you’ve properly placed your #endif statements. Try reverting to the error'ed version to get back to the "3 errors" state, then #if out one block at a time and see if it removes your error messages one by one.