Hi, I’m making a sort of system that indicates proximity to an object.
Essentially, the effect I’m trying to achieve is a GUI that becomes more visible the closer the player is to a certain part, I was thinking of using tweens but I’m not sure if it’d be feasible in this particular case.
I came up with a REALLY crude script that does the job (kind of) but it’s not really smoothed out and that’s the main thing I want to get here, make it more opaque as the player gets closer
local runService = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local GUI = script.Parent
local static = GUI.ImageLabel
local triggerPart = game.Workspace.ExitRoom.ExitDoor.DoorPart
runService.RenderStepped:Connect(function()
if player:DistanceFromCharacter(triggerPart.Position) < 30 then
static.ImageTransparency = 0.75
end
end)
As I mentioned, I’m trying to see if I can use tweening or possibly :Lerp()
but I am not sure if it’s possible.
Any help is appreciated, thank you in advance