Hi! I’m going to be needing a lot of BillboardGui elements in my game and I was hoping I could have some help with it.
To start, I’m having trouble getting the things to work how I want them to. I have a part in my game that I’ve set up in the workspace that acts exactly how I’d like it to, but when I attempt to create and place it on a part in the game it behaves differently than anticipated. Essentially, I want it to shrink as it moves away from the camera, however attempting to edit the scale of the BillboardGui doesn’t seem to be working properly, and even things like attempting to use UIScale don’t seem to be working. Here’s what I’ve tried so far.
local BillboardGui = Instance.new("BillboardGui")
BillboardGui.Size = UDim2.new(1,0,1,0)
BillboardGui.MaxDistance = 32
local Text = Instance.new("TextLabel")
Text.BackgroundTransparency = 1
Text.AnchorPoint = Vector2.new(0.5,0.5)
Text.Position = UDim2.new(0.5,0,0.5,0)
ext.FontFace = Font.new(
"rbxasset://fonts/families/FredokaOne.json",
Enum.FontWeight.Bold
)
Text.Text = <text>
Text.TextColor3 = Color3.new(1,1,1)
Text.TextSize = 100
Text.TextStrokeTransparency = 0
-- Text.TextScaled = true
-- local uiScale = Instance.new("UIScale")
-- uiScale.Scale = .5
-- uiScale.Parent = Text
-- commented because i dont think its 100% needed
Text.Parent = BillboardGui
BillboardGui.Parent = part
Additionally I have a few more problems I’m going to need to resolve. For one, I’m wanting these BillboardGui’s to be parented to a part that has size Vector3.new(0,0,0), and I’m going to need to create heck-of-a-lot of them in a really short amount of time; potentially thousands at once. Any idea of how to optimize this would be greatly appreciated as well.
Finally I’ve run into one more problem with these, this one being a hardware issue. I’m not sure how laggy it is on other computers, but mine is pretty old, so I’m going to need a way to focus only on ones specifically in front of the player in order to not catch my PC alight. I’m thinking of achieving this by attaching a cylinder part to the player’s head and only enabling the ones whose parent parts are clipping with the cylinder. However, being a bit new to the engine, I’m not sure what operation I should be using for this, most importantly which one would be the most efficient.
Additionally, any ideas on how to increase transparency the further away the BillboardGui is from the cylinder would be appreciated. Essentially, it should start phasing in from the side of the player’s vision and only be fully corporeal when close to the center of the player’s vision. It would also be great to have this effect apply when increasing the distance between the player and the BillboardGui. Thank you!