PointLight

Show Deprecated

A PointLight is a light source that emits illumination from a single point. Light is emitted spherically based on the PointLight.Range of the PointLight.

In order for a PointLight to provide illumination, it must be the direct child of a BasePart or Attachment (the part or attachment itself must be a descendant of the Workspace).

If a PointLight is parented to a part, then the light will emanate from the part's BasePart.Position. If a PointLight is parented to an attachment, then the light will emanate from the attachment's Attachment.WorldPosition.

For more light types, see the see also section.

See Also

Code Samples

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

Summary

Properties

  • Read Parallel

    The size of the area that the PointLight will illuminate.

Properties inherited from Light
  • Read Parallel

    Sets how bright the emitted light is, defaults to 1.

  • Read Parallel

    The color of the emitted light.

  • Read Parallel

    If set to true, light will be emitted from the source object.

  • Read Parallel

    If set to true, will project shadows if light is blocked by an obstacle.

Properties

Range

Read Parallel

The size of the area that the PointLight will illuminate.

Methods

Events