PointLight
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
PointLight は、PointLight の Class.PointLight.Range の中心点から光を放って、光を円形に発射するライトソースです。
PointLight が照明を提供するには、BasePart または Attachment (パーツまたはアタッチメント自体が Workspace の子孫でなければなりません) の直接子である必要があります。
PointLight がパーツに親接されている場合、ライトはパーツの BasePart.Position から放出されます。如果 PointLight がアタッチメントに親接されている場合、ライトはアタッチメントの Attachment.WorldPosition から放出されます。
For more light types, see the も参照してください section.
参照してください
コードサンプル
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
概要
プロパティ
ポイントライトが照らすエリアのサイズ。
エミットされた光の明るさを設定します。デフォルトは 1 です。
放出された光の色。
オプションを「ON」に設定すると、光はソースオブジェクトから出力されます。
オプションを「ON」に設定すると、障害物によってライトがブロックされた場合、シャドウを投影します。