Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make billboardgui which isnt resizing when Im going further?

Asked by
Etheroit 178
8 years ago
Edited 8 years ago

Hey, in last time I wanted to create a billboardgui which appears up to player, but its resizing when Im walking further. Is it possible to prevent it? EDIT: I want to make effect like when You are going further, its getting smaller.

2 answers

Log in to vote
2
Answered by 8 years ago
Edited 8 years ago

Just set the scale of the BillboardGui's size property. Setting it to full scale (i.e, {1, 0, 1, 0}) is roughly in proportion to the size of a single stud, so you'll probably want to set this value several magnitudes over the limit. In the gif I showed you, the dimensions were: {10, 0, 10, 0}. Your frame, or whatever GUI object you have inside the BillboardGui, should be set to full scale so it stays in proportion to the BillboardGui's size.

Result yielded

0
Ty :D It works right now. I saw that I have been using offset firstly. Etheroit 178 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

Well, for that your Billboard Gui's Adornee(Parent part) gotta be in Player's Local Camera, so it gets smaller for one player while it's still big for a player which is closer.

Now, let's say there are limits we put and also sizes for these limits.

Limits = {0,30,50,100} --studs far away
Sizes = {(0.25,0,0.25,0),(0.2,0,0.2,0),(0.15,0,0.15,0),(0.1,0,0.1,0)}

Then, let's get Camera's position, and also parent of our GUI

Ador = game.Workspace.CurrentCamera.BillGuiPart
CamCFrame = game.Workspace.CurrentCamera.CFrame

Now, a small if condition to get distance between Camera and Ador And also a for loop

for i = #Limits,1,-1 do
    if (CamCFrame.p-Ador.Position).magnitude > Limits[i] then
        Ador.BillboardGui.Frame.Size = Sizes[i]
    end
end

This will take care of sizing I think. I do not 100% guarantee.

Answer this question