StickyBillboard is an easy to use module that converts any BillboardGui into a StickyBillboard object, which will “stick” to the edges of the screen when the Camera is not looking at the Billboard’s position. StickyBillboard is perfect for creating location markers that are always visible on a player’s screen.
Full documentation and source code can be found on GitHub:
GitHub - MayorGnarwhal/StickyBillboard
How it works:
StickyBillboard works by converting any BillboardGui into a Frame that is rendered in the local player’s PlayerGui. When the Camera is not looking at the adornee position, the StickyBillboard will render along the nearest edge of the screen to always remain visible.
StickyBillboard is an incredibly flexible solution, persisting most BillboardGui properties, as well as supplying a wide range of configuration options to control the behavior.
Example Code:
This is an example of creating a basic location marker HUD (as demonstrated in the video above) using all of the basic features of StickyBillboard.
local billboardTemplate = ReplicatedStorage.Assets.BillboardGui
local adornee = workspace.Baseplate
local sticky = StickyBillboard.new(billboardTemplate, adornee, {
OffScreenSizeMult = 0.75,
Padding = UDim2.fromOffset(20, 20),
})
sticky:BindToUpdate(function(dt, onScreen, direction)
if onScreen then
sticky.Container.Arrow.Visible = false
else
sticky.Container.Arrow.Visible = true
local rotation = math.atan2(direction.Y, direction.X)
sticky.Container.Arrow.Rotation = math.deg(rotation) + 90
end
end)
The demo file for this example can be downloaded here:
stickybillboard-demo.rbxl (69.4 KB)
Get StickyBillboard on Roblox or from the latest GitHub release