SurfaceLight
*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.
Una SurfaceLight è una fonte di luce che emette l'illuminazione di un Light.Color e Light.Brightness da una SurfaceLight.Face per una specifica SurfaceLight.Range .
Perché una SurfaceLight fornisca illuminazione, deve essere il figlio diretto di un BasePart o Attachment (la parte o l'accessorio stesso deve essere un discendente dello Area di lavoro).Se una SurfaceLight è parented a una parte, allora la luce emanerà dalle facce selezionate della parte.Se parented a un allegato SurfaceLight è equivalente a un SpotLight .
Per altri tipi di luce, vedi la sezione vedi anche .
Vedi anche
Campioni di codice
This example creates a new anchored BasePart named Part at the position {0, 0, 0}.
It then creates a new surface light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The surface light's parent is set to the BasePart we created. To view the light, navigate to the part at {0, 0, 0} or move the Part created to a location visible to the player.
Please note that the properties of the created surface light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing surface light, you can also create a similar script that modifies that surface light instead of creating a new BasePart and light.
local part = Instance.new("Part")
part.Anchored = true
part.Position = Vector3.new(0, 0, 0)
part.Parent = workspace
local light = Instance.new("SurfaceLight")
light.Color = Color3.fromRGB(255, 255, 255)
light.Brightness = 1
light.Range = 16
light.Parent = part
Sommario
Proprietà
L'angolo dal quale la luce viene irradiata dalla SurfaceLight.
Imposta il lato del genitore da cui proviene la SurfaceLight.
La distanza dal volto della SurfaceLight che illuminerà.
Imposta quanto la luce emessa è brillante, predefinito su 1.
Il colore della luce emessa.
Se impostato su vero, la luce verrà emessa dall'oggetto di origine.
Se impostato su vero, proietterà ombre se la luce è bloccata da un ostacolo.