How can I make a GUI that appears on the player screen depending on the radius between player and part?

I’ve been trying to make a script that slowly changes the transparency of a GUI depending on how far the player is, basically a danger screen for a killer if you can call it like that. But each time I fail, are there any tips or something? Would be glad if someone could help my miserable suffering

you can check the magnitude between the player and the part or simply use raycasting to create a ray to detect a player’s character and get the length it hit the character at.

1 Like