This video will show you
how to make a hat in Roblox.
Before we begin, it's currently impossible
to upload your own hats to the Roblox catalog,
so the hats that we create in this video
will only be able to be worn within Roblox Studio.
There are many tools that we can use
to create a hat on Roblox.
If you'd like, you can take
a pre-created mesh from the toolbox,
or you can design your own hat using parts.
That's what I'm going to do.
I'm going to create a crown.
Click on the arrow under the part button
to insert a cylinder.
Select the scale tool and drag the handles
to change the size of the cylinder.
Now I'm going to duplicate the cylinder
and use the scale tool again
to make this cylinder slightly smaller,
but also taller in the other axis.
Then, using the move tool, I will move this cylinder
into the middle of our first cylinder.
Select the smaller cylinder,
and in the model tab of the ribbon menu, select "Negate."
Then select the other cylinder
by holding down control, or command on a Mac,
and select "Union" in the model tab.
This will create a hole in our cylinder
so it looks more like a crown.
Now click on the part button to insert another part
and drag it on top of our crown.
Use the scale tool to resize it.
Once you've finished creating your hat,
create another part and name it "Handle."
Make sure that the handle name
has a capital "H" at the start,
otherwise the hat will not work properly.
Resize this handle so that it covers all of the hat.
Then set its transparency to 1.
Let's weld all of the parts we have created
to the handle parts.
Insert a weld into the handle part.
Click on "WeldConstraint."
Set the Part0 property to the handle part
and the Part1 to the other part.
Repeat this for all other parts you've created.
Now right-click on our handle
and choose "Insert Object."
Select an attachment.
Name this attachment "HatAttachment."
This attachment will snap to a position on the player's head
so that if the hat doesn't fit properly,
we can adjust the hat attachment relative to the head.
Move it slightly underneath our crown
by selecting the move tool and by dragging the handles.
Next, in the workspace, insert an accessory
by right-clicking and selecting "Insert Object,"
and then select "Accessory."
Select all of the parts we have created for our hat.
Make sure that the "CanCollide" property is checked
and the "Anchored" property unchecked
in the properties window.
Then drag the parts into our accessory
via the explorer panel.
We've now created our hat.
Let's drag the hat down into the "StarterCharacter"
script folder underneath "StarterPlayer."
Then click on the play button in the ribbon menu.
We will spawn with our hat on.
If the hat doesn't fit properly,
adjust the hat attachment's position to change the fitting.
Make sure also that your handle covers
the entire span of the hat.