Question
Unity Substance Plugin freezes when changing parameters on runtime (Android)
Hello 🙂
I am currently working on a android game trying to change substances in runtime.
The substance is referenced by a script when I build the game (Caching Behavior paragraph) (https://substance3d.adobe.com/documentation/integrations/publishing-for-mobile-172823474.html).
When I use the "Simulator" of Unity to test the game everything works fine - the textures are generated.
Building works fine without any Errors, but when I start the game on android (Huawei P40 Pro) then it freezes.
1.) Do I have to put the .sbsar files in a specific folder so that they work runtime?
2.) Does anyone have the same problem?
3.) Is this a known issue and will it get fixed?
Thank you for taking your time to read this message, I am looking forward to a reply :)!
Substance files I used (https://drive.google.com/drive/folders/1j82w_zCEi5RpJKJ4UPoyKuqXtXcYV0az?usp=sharing)
Unity Version 2021.1.15f1
Substance PluginVersion :
Plugin Info:
Release Version: 2.6.0b
Importer Version: 29
Build Info:
Substance Engine Version: 65545.7.2.9 639766099
Build Number: 118
Commit Hash: 2b1f4be3a8d28
Plugin Commit: bb5b08a59db3d1ee3e4da1f31e6bcfdfc0cde11e
Plugin Build: 53
CODE:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Substance.Game;
public class SubstanceGeneratorTest : MonoBehaviour
{
public Substance.Game.SubstanceGraph substanceGraph;
// Update is called once per frame
void Update()
{
if(Input.touchCount >= 1)
{
if(substanceGraph != null)
{
substanceGraph.SetInputFloat("Color",Random.Range(0f,1f));
// queue the substance to render
substanceGraph.QueueForRender();
//render all substances async
//substanceGraph.RenderAsync(); // both methods dont work. this and the one in the next line.
Substance.Game.Substance.RenderSubstancesAsync();
}
}
}
}
