Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Lens glare appears at the sun and beneath the baseplate?

Asked by 8 years ago

How would I make it so it would go to only the sun?

local camera = workspace.CurrentCamera

game:GetService('RunService').Stepped:connect(function()

    local sunPosition = camera.CoordinateFrame.p + game.Lighting:GetSunDirection() * 10000
    local screenPosition = camera:WorldToScreenPoint( sunPosition )
    script.Parent.Position = UDim2.new(0, screenPosition.x - 300, 0, screenPosition.y - 300)

end)

Answer this question