Variables not working in build - ok in editor

Pulse 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 2

So I have done a hole game with bolt for android and it wasn't working.

I expected that it was a code error so I did change a lot of things. Right now my game is working with 0 errors in the editor (reimported all packs etc) 

Then I found lunara, is like in-game debugging for andorid devices and I got the error:

Variable not found : ("any of my saved variables")

Here is the error (1 of my saved variables):

InvalidOperationException: Variable not found: 'Coins'.
Bolt.VariableDeclarations.Get (System.String variable)
Bolt.GetVariable.Get (Ludiq.Recursion recursion)
Bolt.Unit+<>c__DisplayClass78_0`1[System.Object].<ValueOutput>b__0 (Ludiq.Recursion recursion)
Bolt.ValueOutput.GetValue (Ludiq.Recursion recursion)

Here are the variables:

So, do they need an initial value and this is why I'm getting the error? or is it just a weird bug?

Well, hope someone can help me, thanks!

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Okey they just needed a initial value :)

If any dev see this mark it as answered ty


Hi Pulse!

Just to clarify: Initial variables get created on new games/platforms, whereas Saved variables show you what's saved on your current platform (e.g.: the Unity Editor in this case). This is why they didn't exist on a build.