+2
Missing Information

Bolt v.2.0.0a5 Macros in Prefabs / Android Build

Marcel711 1 week ago • updated 4 days ago 3

I have a Scene Variable of Type GameObject for a Prefab.

This Prefab has a Bolt Macro on it.

I use this Scene Variable in a Spawner to randomly spawn these Prefabs in the scene.

In the Editor GameView everything works. However when I build for Android and test it on a device the Prefabs no longer appear in the scene.

Is this a bug or can't I use Bolt Macros on Prefabs?

Bolt Version:
Bolt v.2.0.0a5
Unity Version:
2018.3.12f1
.NET Version:
4.x
Bolt 2
+1

ok, I found something out: If I assign the Scene Variable to a Instance of the Prefab in the Scene Hierarchy it works but not when I choose the same Prefab from the Assets folder. I'm new to Unity and Bolt, so please let me know if this is normal behaviour. Thanks!

Missing Information

Hi Marcel,

Sorry you're experiencing issues. We need an error log or reproduction steps to be able to help. Can you enable "Debug Build" when building to Android so that the error shows?

Also, make sure you run AOT Pre-Build (under Tools > Ludiq) before building for AOT platforms like Android.

Scratch that, I thought you were using Bolt 1 for a second. 

Hi Lazlo,

thank you for your reply.

The reproduction steps are:

  • New project in Unity 2018.3.12f1
  • Switch Platform to Android
  • Change API Comp Level to .NET 4.x
  • Import Bolt 2.0.0a5
  • Restart Unity
  • Run Full Extract
  • Create Cube
  • Add Flow Machine to this Cube
  • Add Macro to Flow Machine
  • As an example I simply added a "Tween Position" on the Start Event
  • Create a prefab of that cube
  • Remove the cube from scene hierarchy
  • Add new scene variable of type GameObject and assign the cube prefab from the assets
  • Create empty GameObject
  • Add FlowMachine
  • Add Macro
  • On Start Event: Add Instantiate Unit and use the value from the scene variable
  • Generate C# Scripts
  • Test in GameView -> Cube moves
  • Add scene in build settings
  • Build and test on Android Emulator -> Cube doesn't move

    Hope this helps, let me know if you need more info to reproduce.
    I couldn't find "Debug Build", only "Development Build" however where do I find the Error logs?

    I'm really liking Bolt and how easy it makes sripting in Unity, thanks for all your effort!!