Is there a way to have different light classes on the party component and then to enable or disable them? ... for instance.. this spotlight only enabled when party has a certain object on them... or would it be better to add the definition to the object?Khollik wrote: ↑Mon Jun 17, 2019 4:43 pm Hello actually adding the "light" component to the "party" object wasn't the most difficult part:
Code: Select all
defineObject{ name = "party", baseObject = "party", components = { { class = "Party", onDrawGui = function(party, g) end, { class = "Light", type = "spot", range = 12, color = vec(1.3, 0.68, 0.35), brightness = 8, spotAngle = 60, spotSharpness = 0.4, castShadow = true, staticShadows = true, destroyObject = true, shadowMapSize = 256, offset = vec(0, 1.5, -0.4), onUpdate = function(self) local noise = math.noise(Time.currentTime()*3 + 123) * 0.5 + 0.9 self:setBrightness(noise * 6) end, }, }, }