Toggle Material Parameter by Time
Hello! I face the problem to toggle my API Function by time.
The case is that i need toggle material parameter form min to max value by N seconds. Instead of it toggle from min to max throughout N time.
Is it possible to add Toggle Action to Behavior or Tween?
My script.
// -----JS CODE-----
//@input Asset.Material AlphaMat
// @input SceneObject objectWithTweens
var newAlpha = script.AlphaMat.mainPass.AlphaCut;
var toggle = false;
var min = -1;
var max = 1;
// Enable full screen touches
global.touchSystem.touchBlocking = true;
script.api.togglePar = togglePar;
function togglePar() {
toggle = !toggle;
var NewValue = toggle ? min : max;
script.AlphaMat.mainPass.AlphaCut = NewValue;
}


Great keep going..!
Cheers
Vivek.0525