Visual effects
Client scripts (client script … extends VisualEffect or Light) never go to the server: they run
in Play's view, compiled by Kalem's WebAssembly build that comes with the view. Every enabled client
component of a part is an effect (Client scripts).
VisualEffectcomputes the colour of the part (and what is under it) every frame. The first effect gets the material's own colour, the next ones the colour before them. A part an effect paints does not take the scene's light: it glows as it is, so a lit lamp's glass and a neon sign show at night. When the chain leaves the colour as it was (an unlit neon returnsbaseColor), the part is in the scene's light, as without effects.Lightmakes the part a light: the light of the colour it gives spreads from the part's middle and fades out at the distance itsreachproperty says, in metres; black casts nothing. The lights are added to the sun and the ambient light; there are no shadows, the 8 lights nearest the camera are drawn, and a hidden part (the inside of a building seen from outside) casts no light.- An effect's
inputreads a signal: the latest value of the field it is bound to (Signals), from every update of the session. - Its time (
elapsedSeconds) runs only while Play's clock runs, and stands still at a breakpoint. - An effect that cannot be compiled, or that fails while running, is written to the log with a link to its line and switched off for the session; the others go on.
In Uhren Disko, the street lamps' glass has a Lamp light bound to the lamp's lamp.lit, and the
sign's neon is bound to the business's business.open.
The Design tab and Environment Preview run no scripts, and Play's view has no bounds, grid or tools.