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

How do I get the angle a player sees a part?

Asked by
lucas4114 607 Moderation Voter
8 years ago

So, I'm more of a builder than scripter so I'm trying to make a custom reflection thing, It's a decal that gets less transparent the higher angle you see it at, but more transparent the smaller angle you see it at. Heres an example: https://gyazo.com/85182cf975e1524e7a1ca3ce6c3aa81c is how it should look from a smaller angle, the decal more transparent, and: https://gyazo.com/00b28472f2c56d4b4871a22db1e26c93 is how it should look from a higher angle. I know how to do most of the script:

local angle = 0 --????????????????????
while wait() do
    local transparency = (angle/180) / 1.5
    script.Parent.Transparency = transparency
end

But I don't know how to get the angle the player is seeing the part at? It should look different for each player how do I do this..?

1
There's a difficulty in how you define this: every point along the surface of the part has a slightly different angle. To where are you measuring? To the center of the part? BlueTaslem 18071 — 8y
0
What I'm trying to do is reflections for water, the point should be the center of the top, I'll edit the question with a better example.. lucas4114 607 — 8y

Answer this question