Skip to main content

Common Issues - Code

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.

Make sure to Update Playable!
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

Unable to resolve Luna.Unity namespace#

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.

Possible solution:

  • 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)

    images-small

Calling a null function; 'is not a function' error shown#

If you are including an external javascript library into a Unity C# script, and not including the null function in the imported class, it will throw a null error.

Possible solution:

  • Make sure that the functions you wish to call from C# are nested within the javascript external class you are importing into Unity. (Example with more information below)
images-xlarge

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 sdk function. 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.

Usage of the Invoke("string", float time) function calls a method using the time as a repeating interval instead of a delay#

This is likely due to a bug on our end, we are aware of this and are working on a fix!

Possible solution:

  • Use a coroutine and the WaitForSeconds function as a workaround.

Input.mousePosition is returning Vector2(0, 0) when not clicking#

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.

Possible solution: