Hello,
So basically I wanna see what percentage of my camera is up or down.
What I mean by this is you can rotate your camera around, and I want something to be more transparent as you rotate your camera up or down.
- Br, iSyriux
Check the player’s camera orientation by using player.Character.HumanoidRootPart.CFrame.LookVector and divide it by the amount that would be the full LookVector amount (not sure how much that would be).
You can either use the Y component of the camera lookvector or dot product.
The code below will print a value between -1 and 1, -1 being cam looking completely down, 0 looking completely straight, and 1 looking completely up (do note though that the roblox camera Y rotation is clamped so you can’t look exactly up or down and the value will be between approx -0.985 and 0.985.)
local Camera = workspace.CurrentCamera
while true do
print(Camera.CFrame.LookVector.Y)
print(Camera.CFrame.LookVector:Dot(Vector3.new(0, 1, 0)))
wait(0.5)
end
If you don’t want negative values, you can use math.abs
to take the absolute value of the number