SurfaceGui - Roblox GUI Tutorial #8 — Transcript
Full transcript
- 0:00I bet you can't click the button in time
- 0:02wait what is it oh wait I think I just
- 0:05saw it flash for a second wait is it
- 0:07talking about this button over here oh
- 0:08yeah I just saw it again okay well it
- 0:10looks like this is a challenge that this
- 0:12sign is trying to tell me and I don't
- 0:14want to back down from a challenge so
- 0:16I'm going to try and press this button
- 0:18oh oh wait I just missed it okay wait
- 0:19let me try oh oh I just missed it again
- 0:21okay hold on come on
- 0:23come oh this is playing tricks with me
- 0:26let me try it again uh oh my God
- 0:37why do I do this to myself all right
- 0:39let's think about what just happened for
- 0:40a minute so first thing I noticed was
- 0:43that this sign over here has text
- 0:45displayed on it but this sign is a 3D
- 0:49object inside of the word space it's not
- 0:51like a guy screen it's not like a GUI
- 0:54element in my 2D screen it's literally a
- 0:57GUI object inside of the 3D workspace
- 1:00plastered onto the sign part so that is
- 1:04one interesting thing I've noticed about
- 1:06this and basically the same thing can go
- 1:08with this uh part over here that just
- 1:10has this text that has this button that
- 1:13just says boo on it and I'm pretty sure
- 1:15the way we're able to plaster these onto
- 1:18a 3D object is by using what's known as
- 1:20a surface guy which I guess this is what
- 1:23we will transition to uh so that we can
- 1:26understand how to implement surface guis
- 1:28inside of our Roblox games because this
- 1:30is another GUI element that I was going
- 1:32to cover eventually and I guess now
- 1:34would be the perfect time to discuss how
- 1:37these are implemented inside of a Roblox
- 1:38games so with that being said let's go
- 1:41and Implement these inside of Roblox
- 1:43studio now that we understand it let's
- 1:45add these surface guis inside of our
- 1:47game but you might ask where do we add
- 1:50these surface guis if we're let's say
- 1:52trying to add a surface GUI to this part
- 1:55for instance or if I just went into
- 1:57model and I created a new a new part and
- 2:00I just quickly decided to uh scale this
- 2:03up a little bit and also make this
- 2:05anchored so that we have a part ready
- 2:07for if we want to add a screen GUI just
- 2:10like this one over here you might ask
- 2:12how does this all work well if you
- 2:13remember what I said earlier a surface
- 2:16GUI is essentially GUI elements that are
- 2:19attached to a part rather than GUI
- 2:22elements attached to our 2D screen
- 2:25because up until this point when we've
- 2:27been creating GUI elements we've been
- 2:29putting them inside of starter GUI and
- 2:31we've just created a screen GUI and then
- 2:33inside of that screen GUI we've created
- 2:36whatever element that would display on
- 2:38our 2D screen this doesn't exactly work
- 2:40the same way as we're used to because
- 2:43we're trying to essentially make the
- 2:45part the screen itself we're not trying
- 2:47to add elements to our own player screen
- 2:51uh but instead inside of the 3D World
- 2:54inside of a specific part that we want
- 2:57to add the GUI element to it it won't W
- 2:59work the same way as we've been doing up
- 3:01until this point so we're going to have
- 3:03to do a different method so I'm going to
- 3:04delete the screen GUI that we've um just
- 3:07added so to answer the question of where
- 3:09we should put the surface GUI like I
- 3:11mentioned is we should put it directly
- 3:14in the part that we're trying to display
- 3:16GUI elements in so on the right side of
- 3:18the screen let's rename our part so that
- 3:20we know um the part that we're
- 3:22specifying so we're going to say surface
- 3:25part and then we're going to go to the
- 3:28right side hit the plus sign and we're
- 3:29we going to insert a surface GUI hit
- 3:32enter and as you can see we've inserted
- 3:35a surface GUI but there seems to be
- 3:37nothing showing on this uh part and
- 3:40that's because surface GUI basically
- 3:42acts as a container for all the the the
- 3:45GUI elements that we're going to place
- 3:47inside of our part so it's very similar
- 3:49to a screen GUI as it's basically a
- 3:53container for these GUI elements so now
- 3:55we're so now what we're going to do is
- 3:56hit the plus sign and we're just simply
- 3:58going to add in our own guy elements
- 4:01like for instance a text label so as you
- 4:03can see our text label has been added
- 4:05and it shows right here on the the top
- 4:08left of the part rather than our screen
- 4:11this uh text label and if we decide to
- 4:14move around the 3D workspace then we can
- 4:17see perspectively that it's on this side
- 4:19of the part and we can only see this GUI
- 4:22element from this side of the part and
- 4:25not and we can't see it universally like
- 4:28we can on our 2D screen so that is
- 4:31essentially the primary use of surface
- 4:33guis is that we can add these GUI
- 4:35elements onto a specific part rather
- 4:38than having them appear on our 2D screen
- 4:42but now that we have this let me
- 4:43introduce you to some properties that
- 4:45you may find useful and the first
- 4:47property I want to introduce to you is
- 4:49this property down here called a derie I
- 4:52hope I'm saying that correctly uh but
- 4:53basically what a derie is is that this
- 4:56is the property that we set to specify
- 4:59which part are we trying to attach this
- 5:02surface GUI onto now obviously uh the
- 5:05aderi here would be the surface part
- 5:07which is this thing right here um which
- 5:10is essentially just the parent of the
- 5:11surface GUI and you might notice that
- 5:14the ader property is actually left blank
- 5:16and that's because by default the ader
- 5:20of the surface GUI is whatever the
- 5:22parent of the surface GUI is so the
- 5:25parent of the surface GUI is the surface
- 5:27part so automatically Roblox is going to
- 5:30say that the ader for this part is going
- 5:32to be the surface part but let's say we
- 5:34had a model where we have multiple parts
- 5:37and we needed one surface GUI to be
- 5:39attached to one specific part inside of
- 5:42a model and the surface GUI didn't know
- 5:44which one to specify this is pretty much
- 5:46where aery comes in and I'm going to
- 5:48show you how this works so let's go to
- 5:51workspace and let's hit the plus sign
- 5:52and let's add in a model so in this
- 5:54model I'm going to put the surface part
- 5:57inside of here and I'm going to D
- 5:59duplicate the surface part and then move
- 6:01it alongside over here uh let's open up
- 6:03the surface part and let's delete this
- 6:05surface GUI so we're just going to have
- 6:07one here so now we have two surface
- 6:09Parts with one surface GUI over here
- 6:13with one not being over here so if let's
- 6:16say we decided to have this surface
- 6:18gui's ad dery be this part instead so
- 6:21what I'm going to do is I'm going to
- 6:22click on this next what I'm going to do
- 6:25is specify this this surface part
- 6:29specifically so I'm going to click it
- 6:30and as you can see now the surface GUI
- 6:33aie is set to this part rather than this
- 6:37one and it's now being displayed here
- 6:39rather than over here so one specific
- 6:41use case I can think of a joury is if
- 6:43you have a health bar that you want to
- 6:45show on top of your player's head you
- 6:48would specify the adorney to the
- 6:51player's head so that the surface GUI
- 6:53knows exactly which part it should be
- 6:56attached to if it's inside of a model so
- 6:58that is basically what a joury is and I
- 7:00hope that made sense to you so you might
- 7:02notice that this text label is being
- 7:04displayed on this side of the part now
- 7:06you might ask why is it this part why is
- 7:09it this side specifically that this text
- 7:11label could be in it's because this
- 7:13surface GUI has a property known as face
- 7:16which basically specifies which side of
- 7:19the part should all of these GUI
- 7:21elements contain inside of surface GUI
- 7:23face so right now the face property is
- 7:27set to front so all of the gu y elements
- 7:30inside of the surface GUI is facing on
- 7:32the front side of the part which is in
- 7:34this direction but what if we wanted to
- 7:36change this to let's say a different
- 7:39side if we were to click on this
- 7:40dropdown there's all these different
- 7:42properties that can tell us which side
- 7:45of the part do we want these GUI
- 7:47elements to show so we can do the back
- 7:49which is basically the opposite of front
- 7:51so as you can see it's gone from the
- 7:53front but if we turn around it's now
- 7:55displayed on the back rather than the
- 7:57front and we can basically do the same
- 7:59thing
- 7:59with uh all of the other sides so top
- 8:02will be displayed over here and you do
- 8:04kind of have to be careful with uh
- 8:06changing the sides because you're going
- 8:07to have to realign these parts unless
- 8:10you decide to use scales instead of
- 8:12offsets and if you don't know what the
- 8:14difference is you can watch my scales
- 8:15versus offsets video that I made but
- 8:17let's change this back to front just the
- 8:19way it was before there's another
- 8:21property that allows us to always see
- 8:24the elements inside of a surface GUI
- 8:27using this property called Always On top
- 8:30now if you don't know what I'm trying to
- 8:31get at here if we let's say decide to
- 8:33turn around on this part we no longer
- 8:36will be able to see the text label
- 8:38anymore if we turn back around then we
- 8:40can see it but if we're let's say
- 8:42somewhere else like I don't know down
- 8:44here underneath the world then we're not
- 8:46going to be able to see it what we can
- 8:47do to make these elements visible no
- 8:51matter where we are inside of the game
- 8:52is by setting this property called
- 8:54Always on top so if we check this off
- 8:56then what's going to happen is that we
- 8:58can be anywhere inside of the game and
- 9:01we'll still be able to see it so I'm
- 9:02going to go down here and through this
- 9:04floor we can still see that text label
- 9:07that's displayed on that part if we go
- 9:10behind a different part then we can
- 9:12still see uh the text label being shown
- 9:15uh through all of these other parts
- 9:17that's displayed on that part over there
- 9:20the next property is Max distance which
- 9:22basically tells us how many studs will
- 9:25it take for us to not be able to see any
- 9:28of the gu elements inside of the surface
- 9:30GUI once we're at a specific amount of
- 9:33distance or however many studs we are
- 9:36away from the GUI elements are we to be
- 9:39able to see it so the max distance right
- 9:41now is 1,000 studs but let's say we we
- 9:44made it but let's say we made it 50
- 9:46studs instead of 1,000 so right now we
- 9:49should be able to see the elements here
- 9:51but if we decide to slowly move back
- 9:54then we should no longer be able to see
- 9:56all of the elements that are contained
- 9:58inside the surface GUI because we are
- 10:00now over 50 studs away from the GUI
- 10:03elements but if we go back into view
- 10:06then we should be able to see it again
- 10:07so that's basically what max distance is
- 10:10another property we have is z offset and
- 10:12if you remember how the zindex property
- 10:14works it's basically uh in what order do
- 10:17you want to display these GUI elements
- 10:20uh plastered onto the same screen or the
- 10:23same frame or folder or whatever you
- 10:25want to describe it so it kind of works
- 10:27the same way here except where comparing
- 10:29two different except this time we're
- 10:32going to be comparing surface guis uh
- 10:34rather than any of the other elements
- 10:36that we've used in the past so if let's
- 10:38say so if I were to duplicate this
- 10:41surface GUI and if I were to take this
- 10:44text label and change the background
- 10:46color to let's say green then we should
- 10:48be able to see this green text label
- 10:51that's over our other text label in this
- 10:53other surface GUI so if let's say our
- 10:56first surface GUI the one that has a
- 10:59white text label if we make that c
- 11:01offset one then we should be able to see
- 11:05that the white text label is now shown
- 11:07in front of this surface GUI with the
- 11:09green text label so it pretty much works
- 11:12the same way but like I mentioned this
- 11:13is now comparing surface guis rather
- 11:15than any of the other elements that
- 11:17we've worked in the past so I hope
- 11:19you'll find great use with using that as
- 11:20well if you're working with multiple
- 11:22surface guis surface guis also have some
- 11:25lighting properties that basically
- 11:27determine how well we can see these GUI
- 11:30elements based on the game's lighting so
- 11:34before we do that what we're going to do
- 11:36is delete the second surface GUI that
- 11:38has the green text label in it and let's
- 11:40go back to our surface GUI and we're
- 11:42going to disable always on top the first
- 11:45lighting property I want to introduce to
- 11:46you is this property called light
- 11:49influence and this basically tells us
- 11:52how much do we want the game's lighting
- 11:54to impact how well we can see the GUI
- 11:57elements that are placed in inside of a
- 11:59surface GUI so by default the value is
- 12:02one so this basically tells us that this
- 12:04is completely impacted by The Game's
- 12:06lighting so if we let's say moved this
- 12:09surface part to a darker area then we're
- 12:11going to have a harder time seeing the
- 12:13surface part so I'm just going to take
- 12:15this part move it down into the world
- 12:17and as you can see now that the sun is
- 12:20not in our view um this these GUI
- 12:23elements are a little bit harder to see
- 12:26but if we decided to change light
- 12:28influence to zero since this is a value
- 12:31from 0 to one then it's not going to be
- 12:33impacted by The Game's lighting
- 12:35whatsoever but there is something
- 12:37interesting that you may have noticed is
- 12:39that it now is that when we changed our
- 12:42light influence it added in this new
- 12:44property called brightness which
- 12:46basically tells us how much light do we
- 12:48want these guis to emit now that the
- 12:51part is not influenced by The Game's
- 12:54lighting so if we set this back to one
- 12:57then our brightness property is gone but
- 12:59if we set this to anything but one then
- 13:02it's going to show the brightness
- 13:03property so let's set this to zero and
- 13:05let's change this brightness property to
- 13:07something bigger like okay like four
- 13:11which not going to lie that is very very
- 13:13bright so that's an interesting thing to
- 13:15know about when it comes to brightness
- 13:18and light influence now there is another
- 13:20thing that you should keep in mind is
- 13:22that remember how I said that we should
- 13:24turn off always on top and the reason we
- 13:26should do this is because if we turn
- 13:28this back on then the first of all the
- 13:31brightness property is gone and also the
- 13:33Light influence now doesn't change
- 13:35anything because by default now uh the
- 13:38light influence is going to be zero
- 13:40regardless of where we see it inside of
- 13:42the workspace it's not influenced by The
- 13:44Game's lighting and we can also see it
- 13:47wherever um our screen is as long as
- 13:50we're uh in range so that is one
- 13:52important thing to keep in mind when
- 13:54you're trying to change the the lighting
- 13:57properties of the these GUI elements is
- 13:59to make sure that always on top is
- 14:02turned off whenever you're trying to uh
- 14:04change the lighting so that's basically
- 14:06how the the lighting properties work for
- 14:08these parts for these GUI elements
- 14:11before I introduce you to the next
- 14:12property I'm going to add a text button
- 14:15to the surface GUI so I'm going to hit
- 14:18the plus sign insert a text button and
- 14:21what I'm going to do is cover this
- 14:23button uh on the entire screen so I'm
- 14:26going to make the scales one comma 0
- 14:29comma 1 comma 0 so that it's going to
- 14:32cover the entire front side of this part
- 14:35uh I'm also going to make the text
- 14:38bigger by hitting text scaled so that we
- 14:40can see the text okay so now that we
- 14:42have this button here here's where I'm
- 14:44going to introduce the next property
- 14:46called tool punch through distance that
- 14:49may sound like a really weird name but
- 14:52it really does make sense once I show
- 14:54you what this actually does let's say I
- 14:56had my tool equipped we can still press
- 14:58the this button regardless of whether I
- 15:00do have a tool equipped or not so as you
- 15:02can see when I press the button it'll
- 15:04still say down here that my mouse has
- 15:06clicked this button and we can go as far
- 15:09as we want and we'll still be able to
- 15:10press this button regardless if we have
- 15:12a tool equipped or not this is a really
- 15:14interesting and very specific property
- 15:16known as tool punch through distance
- 15:19which basically tells us that uh with
- 15:21this number which is basically in studs
- 15:23how far do we want to be able to press
- 15:25this or interact with this GUI element
- 15:28if we have a tool equipped or not so in
- 15:31this case with this text button if we
- 15:33let's say had the studs as 10 rather
- 15:36than zero then I will have the tool
- 15:38equipped and I should not be able to
- 15:41interact with this button unless I'm at
- 15:44a specific distance between uh the
- 15:47button and my character so now that I'm
- 15:50about 10 studs in range of this guy
- 15:53element I'm now able to interact with
- 15:56this button but if I go out of range
- 15:57then I will know no longer be able to
- 15:59interact with this uh element but if I
- 16:02unequip then I should be able to
- 16:03interact with the element regardless so
- 16:05it's a very specific property but I
- 16:07think you will find use uh with this
- 16:09property if this if a situation like
- 16:12this ever comes uh during your Roblox
- 16:14journey and I hope that you will find
- 16:15use with this property okay so now I
- 16:18want to introduce you to two sizing
- 16:20modes that you can use when it comes to
- 16:24scaling your GUI elements contained
- 16:26inside of a surface GUI so if we have
- 16:28our surface GUI selected let's go down
- 16:31here and check the Siz and category with
- 16:34two properties pixels per stud and
- 16:36sizing mode so by default Roblox is
- 16:39going to set the sizing mode of the
- 16:41surface GUI to pixels per stud which
- 16:44basically gives us a pixel to stud ratio
- 16:47of how we want to scale our GUI elements
- 16:50that are contained in a surface GUI so
- 16:52by default it's by 50 now intuitively
- 16:55what you might do is increase the size
- 16:58of the pixel pixel per stud but the
- 16:59thing about doing this is if we choose
- 17:01to do this it actually makes it smaller
- 17:04which is actually something pretty
- 17:05insane because you might think that if
- 17:07it's bigger you might think that it
- 17:10would make the scale of the text bigger
- 17:12but in actuality it doesn't do that it
- 17:15does it when you do it the other way
- 17:16around uh which will allow you to make
- 17:20it bigger theoretically if you made the
- 17:23pixels per stud smaller and if you're
- 17:25using scales for your text button
- 17:27instead of offset you should be getting
- 17:29this result because I believe if you use
- 17:31offset then it won't have the same uh
- 17:34effect if you change the pixels per stud
- 17:37using the sizing mode so that's
- 17:39basically how the first mode works but
- 17:41if we hit this drop down with sizing
- 17:43mode there's another property called
- 17:45fixed size so if we press this then it's
- 17:47going to give us two properties an X and
- 17:50Y property that allows us to change
- 17:53based on offset with this canvas size so
- 17:56once again with pixels per stud uh the
- 18:00smaller the numbers are the bigger the
- 18:02text will actually display on the screen
- 18:05so for the X property we can change it
- 18:07to 400 instead of 800 and then it would
- 18:10change the x value to be more wide since
- 18:14we made the the x v since we made the x
- 18:17value smaller and we can do the same
- 18:19thing with the y-value make this 300
- 18:21instead of 600 and we can see it be
- 18:23bigger on the y- AIS quote so if we made
- 18:27it even smaller quote unquote then it's
- 18:29going to continue scaling this uh
- 18:32however we so desire to be however big
- 18:34or however small we want it to be and if
- 18:36we change the size of the entire model
- 18:39then it's going to scale it alongside
- 18:41with it if I'm close enough to it then
- 18:42we should be able to see it being
- 18:45scaled so it doesn't really matter which
- 18:47uh sizing mode you use because both of
- 18:49them basically achieve the same result
- 18:52it's just a matter of which one you
- 18:53prefer using over the other one and that
- 18:56is basically how both the sizing modes
- 18:58work when it comes to scaling your GUI
- 19:00elements inside of a surface GUI but
- 19:02with that being said that is basically
- 19:04going to be the end of this episode with
- 19:06surface
- 19:08G if you're interested to learn more
- 19:10about how we were able to scale the size
- 19:13of these GUI elements whether that would
- 19:15be on a part or on our screen I
- 19:18encourage you to watch my scale versus
- 19:20offset video that's a part of this
- 19:23playlist for my GUI tutorial Series so
- 19:25with that being said I hope you found
- 19:27this video to be helpful and I will see
- 19:29you in the next episode take care
About this transcript
This page contains the full transcript of SurfaceGui - Roblox GUI Tutorial #8 by BrawlDev, generated from the public captions YouTube serves with the video. The transcript has 3,793 words across 492 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.