This page is dedicated to common issues surrounding code. If you are experiencing an issue that does not relate to code consider looking at one of the other pages in this section, which are also listed here.
A lot of times issues can be fixed by simply updating your plugin to the latest version, please make sure to check you are on the latest release version before looking further into this section. More info on how to do this here
This could be due to if you are trying to using the Luna API from within another namespace, then the IDE cannot resolve / find the Luna functions.
- At the top of the script add the 'using Luna.Unity' directive and remove the 'Luna.Unity' part of any function call. (Example of this below)
Above you can see that the SDK function is the one being imported into Unity & acts like a class which contains the functions. So all functions used from in Unity needs to be added as nested functions inside the
send is called from Unity & so has to be included inside the sdk function using the
this operator. It cannot be outside the sdk function.
This is likely due to a known issue in our engine.
- Use a coroutine and the
WaitForSecondsfunction as a workaround.
This is likely due to a difference between how Unity and Luna handles this behaviour, and/or because of issues that arise when translating from mouse to touch.
- Use Touch.Position ( Unity - Scripting API: Touch.position )
This is likely due to naming a class/variable the same as a key namespace in our engine, this can end up causing problems.
Examples of such taken names to avoid:
- Change the name of the class/variable name to something different.
This could be happening if you have named the folder that housed the project or scripts 'Editor'.
This is because by default Luna excludes all Editor folders, it just so happens that that includes any folders inside the entire absolute file paths. So if your scripts/project is inside a folder name Editor, your scripts won’t be included.
- Don’t name any folders that you don’t want excluded, “Editor”.
This could be happening if you have a scriptable object with the same name as another one in your project, or a class with the same name (But different namespace).
- Rename the scriptable object/class so it doesn't have the same name as the other.
We do not currently support
system.Math in Luna. If you are making use of either of these then it will cause issues with your luna build.
- Remove the Mathematics / system.Math library and replace with the MathF library. Code can be rewritten using MathF.
We do not currently support this API in Luna.
- When you create an AnimationCurve you can put a parameter with the array of keyframes you need:
AnimationCurve heightCurve = new AnimationCurve(keyframes);
This is likely due to your project including unsupported C# features (7.1 +) in your code.
- Please use a different syntax/features. Examples of workarounds for unsupported C# features can be found here.