This is printing 9 studs, even tho the prompt is over 300 studs away from my character. I press E from where my camera is in game, and it prints Can open merge 9.813133239746094 false
The red part is the EcoMerge.Prompt:GetPivot().Position. As you can see, it’s clearly a lot further than 9 studs away.
Reason I do this is I am trying to only have E work while a billboardgui is visible, so it needs to only work when that billboard is on screen.
UserInputService.InputBegan:Connect(function(input, GPE)
if GPE then return end
if input.KeyCode ~= Enum.KeyCode.E then return end
local ScreenPos, a = Camera:WorldToScreenPoint(EcoMerge.Prompt:GetPivot().Position)
local Distance = ScreenPos.Z
if Distance > 25 or Distance < 0 then return end
print("Can open merge", Distance, a)
self:Open()
end)