PointLight

非推奨を表示

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

ポイントライトは、単一のポイントから照明を発している光源です。光は、ポイントライトの PointLight.Range に基づいて球状に放出されます。

ポイントライトが照明を提供するには、BasePart または Attachment (パーツや添付ファイル自体が Workspace の子孫である必要があります)の直接の子供である必要があります。

ポイントライトがパーツに親属している場合、光はパーツの BasePart.Position から発します。ポイントライトが添付ファイルに親属している場合、光は添付ファイルの Attachment.WorldPosition から発します。

より多くのライトタイプについては、 参照も セクションを参照してください。

参照してください: See Also

コードサンプル

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.

Creating a New Point 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

概要

プロパティ

  • 並列読み取り

    ポイントライトが照らす領域のサイズ。

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

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

  • 並列読み取り

    放出された光の色。

  • 並列読み取り

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

  • 並列読み取り

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

プロパティ

Range

並列読み取り

ポイントライトが照らす領域のサイズ。

方法

イベント