How to radiate light from the player?

Hello! Sorry if this post has been made before but I could not find anything on it. What I am trying to achieve is something like this:

https://gyazo.com/c863c9ecdfde1d13e19e8f9a47864065

As you can see the player has light inside of it, and which follows it, get it? So does anyone know what I can do to achieve something like this? Thanks in advanced!

3 Likes

A point light was probably inserted to their head.

2 Likes

This can be achieved simply by using a PointLight, just create one and place it in the root part of the character, simple example below:

local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local light = Instance.new("PointLight")
light.Range = 20 --adjust as needed
light.Parent = char:WaitForChild("HumanoidRootPart")
11 Likes

Yeah, but how can I go about doing that? Are there any tutorials or something I can follow?

1 Like

By “roof part” You mean the head, correct?

wait oops read root as roof

So in the HumanoidRootPart?

1 Like

I was referring to the HumanoidRootPart; which is basically the torso, or center of the character model.

But, if it’s more fitting to put the light in the head you can do that as well, just change the parent of light to char:WaitForChild("Head")

:slight_smile:

3 Likes

I use a more complicated scenario.

I create “a bulb”, an invisible, untouchable and uncollidable part that hangs in the air just above the player’s head. PointLight is attached to the part. It moves anywhere the player goes, RunService.RenderStepped function is used for it. If you need a sample code let me know.

3 Likes

I currently have a point light parented to a player’s humanoidrootpart, but the light seems to lag around the map and doesn’t follow the player at the rate they move. Any help?

Show your code then, we might help.

The code is literally:

pointLight.Parent = player.Character.UpperTorso

OK, here is my sample (sorry about late reply):

local RunService = game:GetService(“RunService”)

-- WaitForChild is used, because it has to be re-read again after
-- death
RunService.RenderStepped:Connect(function()
	humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
	UT = game.Players.LocalPlayer.Character:WaitForChild("UpperTorso")
	UT_pos = UT.Position
	Umbrella_Light_Pos = Vector3.new(UT_pos.x, UT_pos.y + 5, UT_pos.z)
	Umbrella_Light.Position = Umbrella_Light_Pos
end)

Umbrella_Light is (as described above) is a part 1x1x1, untouchable, invisible & un-what-ever… but anchored=true, attach a point light to it facing down.

Also you can name the function anything you like and declare like this:
RunService.RenderStepped:Connect(Name_of_your_Function)

BTW, on one of my games I use dim zones, where the light brightness slowly falls to zero…