Forum Discussion
Zucchini_Fred
7 years agoExplorer
Error when loading in Oculus Utilities for Unity
Hi,
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!
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!
33 Replies
Replies have been turned off for this discussion
- slukasxrMemberI saw this too! I followed the #define code and saw that in the editor, the class definition is #if’ed out, so just do the same by wrapping
#if !OVRPLUGIN_UNSUPPORTED_PLATFORM
#endif
around the statement groups that are erroring, then you should be on your way!
I can post the actual lines of code when i get to a computer if you need it. Let me know?
UPDATE:
Corrected to read #if !OVRPLUGIN_UNSUPPORTED_PLATFORM
as it works more accurately than the previously suggested #if !UNITY_EDITOR - mitchellhartHonored GuestI'm having the same error. I located the class definition, (private static class OVRP_1_15_0) but mine isn't wrapped in an #if statement. Any ideas? :)
- slukasxrMemberAlright Ocularians, here goes:
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. - mouse_bearRetired Support@Zucchini_Fred Thanks for the heads up! I'm assuming this is happening with the latest Oculus Utilities version 1.27?
- slukasxrMember@NinjaGaijin
Yup! Just re-downloaded it to reconfirm this. The fix is simply to add these line pairs:
#if !OVRPLUGIN_UNSUPPORTED_PLATFORM
#endif
at lines:
2876 / 2890,
2901 / 2917,
2928 / 2936
to OVRPlugin.cs
(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)
Thanks! - Zucchini_FredExplorer@luks0r
That fix worked for me but now I'm getting an error related to
"
private const string pluginName = "OVRPlugin"; "
Assets/Oculus/VR/Scripts/OVRPlugin.cs(2994,9): error CS1525: Unexpected symbol `const', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
did this happen to you as well? - slukasxrMember@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.
- kerskMeta EmployeeHi all, is everyone affected here running the Unity Editor on macOS?
- pewpewresearchHonored GuestI am affected by this bug on macOS, and I can confirm @luks0r's fix worked for me.
- BeingVRExplorerYes, MacOS here. Happens on an empty project.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago
- 1 year ago
- 1 year ago