Need help for Interaction gui

Hi, I’m trying to make interaction gui for my upcoming SCP - Containment Breach game. But i don’t know how can i do this system.

Here is the video about the interaction system:

is it possible to make a system like this in roblox?

1 Like

You can put a billboardgui into the buttons of the doors, and then set their max distance so that they only appear when the player is close to them.

This might lag if there are too many buttons, so you can also use a script to detect if a player is near one of the buttons.
(this is a local script)

local buttons = game.Workspace.Buttons -- folder where the buttons are
local plr = game.Players.LocalPlayer -- the player
local maxButtonDistance = 5 -- max distance for a button to appear

while task.wait() do -- check if the player is near a button every frame
	for i,v in pairs(buttons:GetChildren()) do -- loop through all the buttons
		
		local gui = v:FindFirstChild("BillboardGui") -- get the gui
		
		if plr:DistanceFromCharacter(v.Position) < maxButtonDistance then -- check if the distance between a button and the character is less than the max distance
			if not gui then -- if there is no gui then we put it in the button
				script.BillboardGui:Clone().Parent = v
			end
		else
			if gui then -- if there is a gui then we get rid of it
				gui:Destroy()
			end
		end
	end
end
3 Likes

Could also use proximity prompts for this. I have a similar interaction system in my game to open doors and pickup items and it all uses proximity prompts. It’s good because you can easily setup interactions to click and activate or a click and hold for X amount of seconds to activate

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.