Hi, in my mainLevel.lua I already have code for switching on and off lightsources by daytime. I have a couple of TSStatic items which make use of the glow property at stage 0 in materials. Is it possible to switch the glow property to false(0) or true(1) in the onUpdate() function? Like local mat = scenetree.findObject(matName) mat:setField('glow', 0, 0) or mat:setField('glow', 0, 1) and refresh the material? In material editor you can switch this property without problems. I'm just happy that I got the VS Code debugger running but I have no luck with this at the moment. It's my very first lua experience, haha! Best! Alex
You can call the functions Code: mat:flush() mat:reload() after changing the properties to update the material
I just implemented it and it works perfectly. I was worried that it’s very hard on the performance but it fluently changes the glow of the materials. It’s a nice effect if some windows in buildings have a glow effect at night. It’s not so easy to do with the light sources in BeamNG. Thanks again!