Hello,
I wish to change dynamically this value on a material. Which way can I do that?
Thank you

Hello,
I wish to change dynamically this value on a material. Which way can I do that?
Thank you

using UnityEngine;
using System.Collections;
public class EmissiveColorSet : MonoBehaviour {
public Color _color;
public Material mat;
void Start() {
}
void Update()
{
mat.SetColor("_EmissionColor", _color);
}
}
It is not the color I wish to change, but value on the box into the red circle I made. The multiplier?
I tried something like this:
render.material.EnableKeyword("_EMISSION");
DynamicGI.SetEmissive(render, new Color(1f, 0.0f, 0.0f, 1.0f) * 10);
render.UpdateGIMaterials();
DynamicGI.UpdateEnvironment();
But I didnt succeed to scale the emissive dynamically during game.
I wonder if there is some pre requisite on the material to activate, or in the environment?
It is not the color I wish to change, but value on the box into the red circle I made. The multiplier?
– thyshimrodI'm happy to help you out with your code but probably not in the comments thread just because I'm not immediately sure what the problem is so the will probably be some debugging to do. Feel free to email me at bdoobie01@gmail.com and I can help you out directly.
– unity_ek98vnTRplGj8Q