How could I make a billboard appear with a text when I pass my mouse over an object, and if I do it, it activates a certain function, I would do this with the ClickDetector and put an image with a text, but this would look very false, besides I have I’ve seen many games with this system like The Mirror by Egroce, how could I do this?
Hey there,
You can use a client-sided localscript to detect if the mouse touches that specific part. I have included some resources below.
Roblox Dev Hub - Mouse
Roblox DevForum Post
Let me know if you need any more help.
As @CadenDevelops said, you could create a LocalScript to access the player’s mouse and everytime the player moves it’s mouse you can check if the object(if any) the player is pointing to is that specific part. Once the check is passed all you need to do is :Clone()
the Billboard(from wherever it is stored) and parent it to the part where it will be displayed.
https://developer.roblox.com/en-us/api-reference/class/Mouse
What you’re looking for is mouse.Target. see above for more details.
local Replicated = game:GetService("ReplicatedStorage")
local BBGui = Replicated:WaitForChild("BillboardGui")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
if Mouse.Target.Name == "Part" then --Change to name of desired part(s).
local BBGuiClone = BBGui:Clone()
BBGuiClone.Adornee = Mouse.Target
BBGuiClone.Parent = Mouse.Target
end
end)
What everyone else has suggested in the form of a script.