SetLightIntensity
(Difference between revisions)
(Created page with "Modify the light intensity. Example 1 : With the help of a timer, the light intensity will increase & decrease over time. Light0 = getObject("Light0") t = 0 --...") |
Dahnielson (Talk | contribs) |
||
Line 14: | Line 14: | ||
print(t) | print(t) | ||
end | end | ||
+ | |||
+ | [[Category:Lua scripting]] |
Revision as of 18:09, 4 February 2014
Modify the light intensity.
Example 1 : With the help of a timer, the light intensity will increase & decrease over time.
Light0 = getObject("Light0") t = 0 -- Scene update function onSceneUpdate() flash = getLightIntensity(Light0) t = t + 1 if t < 50 then setLightIntensity(Light0, flash+0.02) end if t > 50 then setLightIntensity(Light0, flash-0.02) end if t == 100 then t = 0 end print(t) end