Alright, so I have basically made custom proximity prompts using billboardGUI’s but the issue is, it shows them all at once as long as you are in distance with the MaxActivationDistance and when you press E, it triggers every single one you are in distance with. How would I make it so that only one of the billboard gui’s displays at once, and also with the magnitude so it doesn’t trigger them all?
How come so many billboards are close together? Last time I checked they were massive on city buildings!
Maybe try turning down the MaxActivationDistance
Or maybe you could hot key each billboard to a different button!
What kind of game is this anyways?
It’s for handcuffs, so when you have the handcuff tool equipped and you’re within reach with the player, the billboard GUI shows up.
And sometimes, there are a lot of player’s in one area.
Uh oops thought you meant like an actual billboard
Is it like one person uses the handcuffs and the script ends? There shouldn’t be too much of a problem it would just be the first person who gets it
You’ll want a central piece of code to manage which ones are on. Just loop through all the custom prompts, see which ones can be on, then decide which one should be on and enable that one.
You also might want to look into customizing the proximity prompt system. It’s not too hard to do.
Oh, you want to know which prompt you should enable? I would pick the one closest to the direction the player is looking:
local camera = workspace.CurrentCamera local position -- The position of the proximity prompt in question local cameraLookVector = camera.CFrame.LookVector local deltaPosition = position - camera.CFrame.Position local distanceFromLineOfSight = deltaPosition:Cross(cameraLookVector).Magnitude
distanceFromLineOfSight is the value you should compare for each prompt. (Lower means higher “show priority”.)
What the math does/represents
Before comparing that value I would make sure the prompt is on screen. There is a function in the Camera Instance to do that. There are also some tutorials on the forums that can explain how to do that.