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 solo punto. La luce viene emessa sfericamente in base al PointLight.Range del PointLight.
Perché un PointLight fornisca illuminazione, deve essere il figlio diretto di un BasePart o Attachment (la parte o l'附件 stesso deve essere un discendente del Workspace ).
Se un PointLight è parented a una parte, allora la luce emanerà dal BasePart.Position della parte.Se un PointLight è parented a un allegato, allora la luce emanerà dall' allegato di Attachment.WorldPosition .
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 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 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.