playMaker

Author Topic: SetProceduralFloat on mobile[SOLVED]  (Read 1797 times)

Norfair

  • Playmaker Newbie
  • *
  • Posts: 3
SetProceduralFloat on mobile[SOLVED]
« on: December 05, 2013, 04:10:50 PM »
Hello! I am running into a weird issue with the SetProceduralFloat that noone else seems to be having. I have a variable being incremented every second (burntAmount) from 0.0f to 1.0f, and that is being passed into the SetProceduralFloat Action. When I run the game, the parameter slider doesn't move at all...BUT when I click and drag the slider, I see the substance parameter update.

Here is the exposed substance parameter:


Here are my playmaker actions for this:


Here is what happens when I click and drag the slider (I had to shop it a little bit to portray what I see :):


I am using Unity 4.3 and Substance Designer 4. Thanks in advance!
« Last Edit: December 09, 2013, 02:25:05 PM by jeanfabre »

Norfair

  • Playmaker Newbie
  • *
  • Posts: 3
Re: SetProceduralFloat
« Reply #1 on: December 06, 2013, 09:51:59 AM »
I just did a test to see if anything was wrong with the Substance Designer 4 export, but it works as expected. I wrote what I think the Playmaker action should do exactly.

Code: [Select]
using UnityEngine;

public class SubstanceTest : MonoBehaviour
{
public ProceduralMaterial substance;
private float burntAmount = 0.0f;

private void Update()
{
burntAmount += 0.01f * Time.deltaTime;
substance.SetProceduralFloat("BurntAmount", burntAmount);
substance.RebuildTextures();
}
}
« Last Edit: December 06, 2013, 09:54:22 AM by Norfair »

Norfair

  • Playmaker Newbie
  • *
  • Posts: 3
Re: SetProceduralFloat
« Reply #2 on: December 06, 2013, 10:31:29 AM »
I solved this issue. I took a look at the actions themeselves and saw the '#if' that pretty much only allows SetProceduralFloat and Rebuild Textures to work on PC, MAC, etc...not mobile. I know substances weren't recommended for use on mobile a couple versions back, but it seems that the devices are becoming more and more capable of generating substances on the fly. Know that performance could still be an issue for complex substances!


tl;dr
to get the substance actions to work on mobile, get rid of or modify the platform specific if statement inside the actions.