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

Pasting SurfaceGui into CurrentCamera?

Asked by
iFlusters 355 Moderation Voter
8 years ago

Everything is working but when I paste it into CurrentCamera the SurfaceGui does not go onto the wall that it was on when I put it into ReplicatedStorage, instead it puts it infront of the player

local Player = game.Players.LocalPlayer

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = ReplicatedStorage:WaitForChild("Storage")
local RepGuis = Storage:WaitForChild("Guis")

local StatGui = RepGuis:WaitForChild("SurfaceGui")

StatGuiClone = StatGui:Clone()
StatGuiClone:WaitForChild("TextLabel").Text = Player.Name.. "'s stats" 

StatGuiClone.Parent = game.Workspace.CurrentCamera

1 answer

Log in to vote
1
Answered by
shayner32 478 Trusted Moderation Voter
8 years ago

Make sure that you are setting the Adornee of the SurfaceGui! The Adornee sets the part that the SurfaceGui appears to be on. You can do this by adding the following line to your script, right after you clone it:

StatGuiClone.Adornee = workspace:WaitForChild("PartName")

Replace PartName with the name of the part you want the Gui to be on, and it should appear on that part.

Ad

Answer this question