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!
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")
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.
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?
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…