Ulla42Join Date: 2009-12-14 Post Count: 1774 |
brt.Frame.BackgroundTransparency = 1 / Distance * Factor * Transparency
When I get closer the transparency decreases, vice versa.
I want it to do the opposite, how do I do that? |
|
|
brt.Frame.BackgroundTransparency = Distance * Factor * Transparency |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
Nope, That made the transparency go over 1 no matter where you are. |
|
|
Do you want it to approach 1 asymptotically? As the distance approaches infinity, the transparency approaches 1?
Try this:
-1 / ((Distance * Factor * Transparency + 1) + 1) |
|
|
Wait... Your original formula should be making it such that your transparency Increases as you get closer. |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
Same as before, except everything is black.
Current = Closer to the brick, makes it darker
I want = Closer to the brick, makes it lighter |
|
|
That makes no sense. Your original formula is doing exactly that. |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
Bump :\ |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
It actually isn't..
local POS = script.Parent.Position
Transparency = 5 -- The bigger this is, the less effect the lighting has.
Distance = 125 -- Change this to the distance you can see it from.
while true do
Players = game.Players:GetChildren()
wait(.1) --don't hog the CPU
for P = 1, #Players do
Torso = Players[P].Character:FindFirstChild("Torso")
local brt = Players[P].PlayerGui:findFirstChild("BRT")
Factor = ((Players[P].Character.Torso.Position - POS).magnitude)
if (brt ~= nil) and (script.Parent.Enabled.Value == true) then
brt.Frame.BackgroundTransparency = 1 / Distance * Factor * Transparency
end
end
end
|
|
|
brt.Frame.BackgroundTransparency = 1 - (1 / Distance * Factor * Transparency)
???? |
|
AgentFirefoxTop 100 PosterJoin Date: 2008-06-20 Post Count: 22404 |
What if Distance or Factor or Transparency is 0?
FLAW |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
For that sir, You gain +1 Cookies. |
|
|
do you mean I gain a cookie? YAY :D |
|
|
You have just set your Distance and Transparency values too high. With what is happening now, you'd need a to be 1/625 of a stud away to get a transparency of 1. At just 1 stud away, your transparency will have become 1/625, which is already almost complete opaque. The transparency will continue to decrease as you move further away. |
|
Ulla42Join Date: 2009-12-14 Post Count: 1774 |
Nevermind. I'll just change the effect from light to dark. |
|