I have a sort of “tooltip” GUI that pops up whenever a player clicks another player, and while it does come up smoothly, whenever I want to press one of its options, most of the time it won’t work.
I’ve already searched around the devforum, and almost everybody who has had the same problem has fixed it by setting the “Active” property in the BillBoardGUI to true, but I’ve already set that property to true (as well as setting the adornee to the part and parenting it to PlayerGUI) with no results.
The script behind this is very simple, and other normal conditions it would work
local giveMoney = script.Parent:WaitForChild("Frame"):WaitForChild("GiveMoney")
giveMoney.MouseButton1Click:Connect(function()
print("Clicked")
--// GUI Parenting, etc.
end)
I’ve been searching around for a couple hours now, so any help on this would be awesome
I don’t think BillboardGui’s are clickable. I have a better idea.
The Idea
Use a ScreenGui
Make the Gui follow the player using :WorldToScreenPoint()
Throw it in a RenderStepped loop
The code
This is an example, but here’s what you should do.
-- When player is clicked
...
local Gui = Gui:Clone()
Gui.Parent = Player.PlayerGui
while Opened do -- Create open variable
RunService.RenderStepped:Wait()
local ScreenPoint = Camera:WorldToScreenPoint(Head.Position + Vector3.new(0, 1, 0)) -- Get the screen point
Gui.Frame.Position = UDim2.new(ScreenPoint.X / Gui.AbsoluteSize.X, 0, ScreenPoint.Y / Gui.AbsoluteSize.Y, 0) -- Covert Offset to scale
end
BillboardGuis can be interacted with if they’re under the PlayerGui. It’s just that at times they can be particularly finnicky depending on the circumstances behind the BillboardGui’s setup. I personally never make interactable BillboardGuis, never saw a need for them.
Also, in terms of loops, that isn’t a RenderStepped loop, that’s a while loop relying on render ticks as an interval. You shouldn’t use a while loop for this if you’re going to use a RunService event and you shouldn’t use RenderStepped either since various tidbits of code can block render ticks from executing. It’d be better to run this under Heartbeat which is fired after physics simulation.
I’m a bit of a beginer but I’ve been working with both Billboards and playerguis.
I think a billboardgui is only ever needed if you want to have a gui in the world such as like in Billionaire simulator where you can go and see what other’s have in their shops. Or a big sign showing then top earners of all time or something like that. A big sign in the world for everyone to see. You can put buttons on it.
But what you seem to be suggesting is a gui that comes up when you click a player and buttons to click in that gui afterwards. As in, click the player, Gui comes up, you type in the amount, click give, click, Yes I’m Positive, and it transfers the money and closes the Gui.
Use StarterGui, and have the gui in the player client offscreen. When the player clicks another player, the gui tweens out and you have your buttons and stuff on the gui. Close it and it returns to offscreen.
I’d be wondering how to get the click to trigger the gui for the player but you seem to have that bit worked out.