SurfaceLight

非推奨を表示

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。

サーフェスライトは、指定された Light.ColorLight.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.

Creating a New Surface 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 が来る親の側面を設定します。

  • 並列読み取り

    表面ライトの顔から照らされる距離。

Light から継承した プロパティ
  • 並列読み取り

    放出される光の明るさを設定し、デフォルトは 1 です。

  • 並列読み取り

    放出された光の色。

  • 並列読み取り

    真に設定されると、光はソースオブジェクトから放出されます。

  • 並列読み取り

    真に設定された場合、光が障害物によってブロックされた場合、プロジェクトのシャドウを投影します。

プロパティ

Angle

並列読み取り

光がサーフェスライトから照射される角度。

並列読み取り

SurfaceLight が来る親の側面を設定します。

Range

並列読み取り

表面ライトの顔から照らされる距離。

方法

イベント