andrea.padovani Posted November 3, 2020 Share Posted November 3, 2020 Dear all, Sorry for this really basic and "noob" question but i'm just trying to move from another engine, and I'm little bit "lost" So.....I've now my model with their material, and emission turned ON with specific texture, and the result compared to other engine in terms of graphics out of the box is really amazing! But now I want to access that material by a script, and turn on/off emission at runtime, maybe at "L" key press or something like that. Any tips or example that I can follow to achieve this result ( I have basic programming knowledge but totally new on UNIGINE ) Thanks ;) Link to comment
fred.naar Posted November 3, 2020 Share Posted November 3, 2020 ok add make a reference to the material as component property then add this to your code, to see all available parameters for (int i = 0; i < Material.NumParameters; i++) { //Log.Message("\n" +Material.GetParameterName(i)); } the parameter you are looking for should be "emission_scale" use it like this Material.SetParameterFloat("emission_scale", 0.3f); 1 Link to comment
Recommended Posts