PointLight
*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.
Un PointLight è una fonte di luce che emette illuminazione da un singolo punto. La luce viene emessa in sfera in base alla PointLight.Range della PointLight.
Per fornire illuminazione, un PointLight deve essere il figlio diretto di un BasePart o Attachment (la parte o l'accessorio stesso deve essere discendente del Workspace).
Se un PointLight è parented a part, then the light will emanate from the part's BasePart.Position . If a PointLight è parented to anattachment, then the light will emanate from the allegato's Attachment.WorldPosition .
For more light types, see the vedi anche section.
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 point light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The point 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 point light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing point light, you can also create a similar script that modifies that 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("PointLight")
light.Color = Color3.new(1, 1, 1)
light.Brightness = 1
light.Range = 16
light.Parent = part
Sommario
Proprietà
La dimensione dell'area che il PointLight illuminerà.
Imposta quanto sia luminosa la luce emessa, predefinita a 1.
Il colore della luce emessa.
Se impostato su true, la luce verrà emessa dall'oggetto fonte.
Se impostato su true, proietterà ombre se la luce è bloccata da un ostacolo.