SurfaceLight
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
サーフェスライトは、指定された Light.Color と Light.Brightness から SurfaceLight.Face に照明を発し、指定された SurfaceLight.Range に向かって ライトソースです。
サーフェスライトが照明を提供するには、BasePart または Attachment (パーツまたは添付ファイル自体がワークスペースの子孫である必要があります)の直接の子供である必要があります。サーフェスライトがパーツに親属している場合、光はパーツの選択された面から放射されます。親に付属する場合、付属の SurfaceLight は SpotLight と同等です。
より多くのライトタイプについては、 も参照してください セクションを参照してください。
参照してください: See Also
コードサンプル
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
概要
プロパティ
光がサーフェスライトから照射される角度。
SurfaceLight が来る親の側面を設定します。
表面ライトの顔から照らされる距離。
放出される光の明るさを設定し、デフォルトは 1 です。
放出された光の色。
真に設定されると、光はソースオブジェクトから放出されます。
真に設定された場合、光が障害物によってブロックされた場合、プロジェクトのシャドウを投影します。