[color=#999999]UPDATE 23 OCTOBER 2019: I have entirely rewritten this thread. Certain replies may seem a little bit out of context as a result of this edit, but after re-reading this thread, I have decided that it is not up to the standards I’d like to hold it to. As such, I’ve updated it with new contents. I have also updated this thread to use Blender 2.8.[/color]
[color=#999999]It should be far easier to read, far more organized, and much more presentable.[/color]
Hey all.
In this thread I will be going over some tricks to ensure that the meshes you upload are set up and ready to go on Roblox. I do not go over tips for 3D modelling in itself. I will be using Blender for this tutorial, which is outstanding if you need a free solution to 3D modelling. You can get it at https://blender.org/ or on Steam at steam://store/365670.
[color=#999999][size=1]n.b. The Steam protocol URL above points to my own website to redirect to Steam protocol URLs. The site was designed to allow usage of this protocol on websites / services that don’t natively support it (e.g. Discourse)[/size][/color]
This thread goes over the following points:
- Things to do when importing to Roblox to ensure the size and appearance of your model is correct.
- Good practices with collision on your meshes to ensure proper interaction and performance.
There are also a number of things to assume in this tutorial:
- All keybinds use Windows terminology. If you are on a Mac, all mentions of Ctrl should be treated as ⌘ Cmd instead, for example.
Importing To Roblox
This part goes over some tricks in your 3D editor of choice. These tricks may not exclusively apply to Blender.
Section 1: Scaling models to be correct on import.
Blender units are proportional to Roblox units. Specifically, 1 Blender unit is 100 studs. If you export a mesh with the default settings, your model will be 100x bigger than it needs to be!
There are two possible ways to tackle this problem. The primary method is to edit the appearance and unit scale in Blender (I prefer this method), and the second method is to edit the export parameters when you export your model. I will go over both methods.
Method 1: Editing Unit Scale
Editing the unit scale in Blender is super easy! You’ll want to start by navigating to the [color=#3FFF7F]Scene[/color] tab and opening the [color=#3FFF7F]Units[/color] dropdown category.
After you make it here, you’ll want to edit the [color=#3FFF7F]Unit System[/color] and [color=#3FFF7F]Unit Scale[/color] values so that Unit System is set to Metric and Unit Scale is set to 0.01.
You may notice that your grid is incredibly large now. We will fix this next. Navigate to the dropdown menu for [color=#3FFF7F]Overlays[/color] at the top of Blender, and change the [color=#3FFF7F]Scale[/color] to 0.01.
Now, exporting meshes with the default settings will make one Blender unit identical to one Stud! This should streamline the import process quite a bit.
Method 2: Editing Export Scale
This is the simpler solution, but I personally believe that it is more of a bandage solution rather than the proper way to do it.
When exporting your models, you will see a “Scale” value.
You will want to set this value to 0.01 when exporting. You will need to set it every time you open Blender, so if you forget, it will have adverse effects.
Section 2: Using normals to save poly-count and keep things smooth.
Normals are a feature of all 3D models that changes how light appears to reflect off of a surface. Since we are in a computer 3D environment, we are not constrained by the limits of reality. Imagine holding up a sheet of paper so that it is flat and upright. In a 3D program, we could edit the normals of this paper so that it reflected light as if (and, by extension, looks like) the sheet of paper was bent into a C shape.
Normals can be used to make lowpoly models look smooth and hide part of the fact that they are lowpoly.
Making the mesh smooth
Making the mesh smooth is incredibly easy. Start out by going into Edit Mode by setting the [color=#3FFF7F]Object Interaction Mode[/color] in the top left of your screen to Edit Mode, or press Tab to swap between Object and Edit mode. Make sure you have the object you want to edit selected.
If the mesh is not already selected (all orange), select everything on the mesh by pressing Ctrl A. Everything should be orange. If it’s not, press it again.
[color=#AAAAAA][size=2]Note: If you use 2.7 era controls like I do, simply press A without holding Ctrl. This can be configured in Edit → Preferences.[/size][/color]
Now, go up to the [color=#3FFF7F]Mesh[/color] tab at the top of the screen, go into the [color=#3FFF7F]Shading[/color] subsection. Select [color=#3FFF7F]Smooth Faces[/color]. You can also search for this option by pressing F3 [color=#AAAAAA][size=2]Or for 2.7 era controls, Space[/size][/color]
When you click this, your mesh will suddenly appear quite odd. It will be automatically smoothed out so that the transition between faces is gradual.
Catch case: What if I want to keep some parts sharp (able to tell there’s two separate faces somewhere, or have a distinct flat surface)?
Thankfully, this is possible too!
You should start out by going to [color=#3FFF7F]Edge Selection Mode[/color] by clicking the icon of the Edge at the top of the screen, next to the Edit Mode button.
(See the icon)
Next, select the edges that you want to keep sharp. If you have any edges in a loop (for instance, the end of a cylinder), you can hold Alt and select an edge. Blender will attempt to automatically select the loop.
In this example, I will be doing this to a cylinder.
See how the edges on top and bottom are selected?
[size=1]n.b. since all of those edges make up a face, which is the end cap of the cylinder, it also selects and highlights that entire face.[/size]
After you’ve done this, go to the [color=#3FFF7F]Mesh[/color] tab at the top of the screen, and go into the [color=#3FFF7F]Shading[/color] subsection again. This time, you will click [color=#3FFF7F]Sharp Edges[/color]. The edges you have selected will be highlighted in a [color=#00FFFF]Cyan[/color] shade to indicate that they are sharp. You can also press F3 and search “Sharp Edges”. If you want to undo this, select the “Smooth Edges” option instead.
[color=#AAAAAA][size=2]Note: I recommend mousing over Sharp Edges and Smooth Edges in the Shading menu and right clicking on them, which will allow you to add them to your favorites (accessable via pressing Q anywhere in Blender) and access them with a single button instead of going to the Mesh menu every time.[/size][/color]
After you’ve marked your edges as sharp, we need to split the mesh so that it knows there should be clear seams on those edges.
Go back to Object mode (same way you got to edit mode, but select object mode this time), go to the [color=#3FFF7F]Modifiers[/color] tab on the right of your screen, click [color=#3FFF7F]Add Modifier[/color], and select [color=#3FFF7F]Edge Split[/color].
This will create a new Edge Split Modifier. Deselect the “Edge Angle” Checkbox so that it is OFF.
My cylinder now looks like this:
See how the top and bottom caps are sharp and no longer have shading to smooth out that edge?
[color=#FF0000]IMPORTANT:[/color] When you export your models, you will need to check the [color=#3FFF7F]Apply Modifiers[/color] checkbox! You can also apply the modifier yourself, but this action is irreversible (you can undo it, but if you save the model and exit Blender, that’s it). If you forget to do one of these two, the Edge Split will not be applied.
[color=#AAAAAA][size=2]Note: Checking the “Apply Modifiers” option in the export menu does NOT irreversibly apply the modifier. It will keep it in the Modifiers list on the right of your screen so you may continue to work with it on.[/size][/color]
Section 3: Ensuring your mesh can be seen from all angles (For flat / 2D geometry only)
This section is obsolete. Click here to view.
Roblox uses a feature called “Backface Culling” for meshes. If you’ve ever flown your Studio camera inside of a mesh you’ll notice that you can see out of it as if it’s not actually there. This is what Backface Culling does: It blocks out the back side of geometry from being visible.
If you upload any meshes with plane geometry (a 2D flat shape, like a single stray face), this will adversely affect your mesh. For instance, say you have a flat plane for a grass texture. Due to backface culling, this grass will only be visible from one side.
You can visualize this in blender by going up to [color=#3FFF7F]Viewport Display[/color], and checking the [color=#3FFF7F]Backface Culling[/color] box.
Now, any faces you view from the wrong side will appear transparent.
You can remedy this problem with another modifier. Go to the [color=#3FFF7F]Modifiers[/color] tab on the right and add the [color=#3FFF7F]Solidify[/color] modifier.
After adding this, you can keep its [color=#3FFF7F]Thickness[/color] value at its default, or you can set it to 0 if you want perfectly flat geometry to be preserved.
[color=#FF0000]IMPORTANT:[/color] If you turn backface culling off and have thickness set to 0, you will notice Z-fighting. This will not be visible in Roblox, so this is okay to see. It may be annoying in Blender, however, so I recommend keeping Backface Culling on.
Roblox now offers a property named DoubleSided
on MeshPart
instances that disables backface culling. This performs the same task, but does not double the poly count of the uploaded mesh.
Collision Best Practices
I’m certain many of you know about the issue where Unions and MeshParts don’t have realistic collision in many cases. Fortunately for you, this has a remedy.
In Roblox, collision can be very expensive. If your place uses a lot of unions or meshes, having their CollisionFidelity property set to Default
can cause extreme lag in some cases. Hull
is considerably less laggy in most cases, and Box
is the fastest in all cases.
I recommend getting CloneTrooper1019’s “Show Decomposition Geometry” plugin to view MeshPart and Union collisions.
There are some rules to keep in mind when adapting your mesh to have proper collision.
Rule #1: If you can use primitives, you should use primitives.
One example of this is if I upload a highpoly sphere because I think Roblox’s spheres look bad for my game. You may think that setting its collision to Hull
is a good idea since it can perfectly represent your mesh. However, this is false – Setting it to Hull
is a bad idea! Why?
First off, a convex hull preserves flat edges. This means that if your mesh rolls, it will wobble or get offset, because it’s still relying on super small, flat faces. Second, the game has to calculate that collision. Although hulls are generally fast, this takes resources.
It is a better choice to add a default Roblox sphere of the same size, make it transparent, and weld it to the same location as the mesh sphere. The mesh sphere should have its collisions disabled and should have its Massless
property set to true. All physical properties should be given to the Roblox sphere. This is a better choice because Roblox spheres use actual radial collision – This means they will flawlessly behave like a sphere, and collision is super fast to calculate. Additionally, given that your mesh is intended to be a sphere, the physical properties should be assigned to the Roblox sphere which, in the eyes of the physics engine, is a 100% perfect sphere. As a result, the behavior will be more accurate if you assign physics to the Roblox sphere instead of your mesh.
This idea also applies to using multiple primitives to make collision for your mesh. It’s generally better to use welded / anchored primitives instead of the actual mesh collision, especially for complex interaction.
Note: If your mesh can use box collision safely, it is better to use the mesh with its CollisionFidelity property set to Box! Adding a special part just for this is a waste. Please remember that this is less of an indisputable rule and more a guideline. In some cases it’s probably better to use more precise collisions, and every game is different, after all.
Rule #2: If you don’t need to collide with it, you shouldn’t be allowed to.
Any meshes you use in the background that players or other parts won’t be able to interact with (no walking on it / colliding with it, no Touched
connections) should have their CollisionFidelity set to Box
, their CanCollide
property set to false, and their CanTouch
property set to false. This will improve performance.
[size=2]* Adding any constraints, BodyMovers, or any other physics-based instances will make the physics engine calculate information for this part unless it is Anchored. Connecting any Touched events will also cause the physics engine to calculate for this part, even if it is Anchored, unless CanTouch
is false, in which case the Touched
event will simply never fire.[/size]
What do you all think? Anything you think should be added? Any stuff I missed? Let me know in the replies so I can improve the thread!