How to Change a 3D Model Material in Godot

Terry Barnes23 min read
How to Change a 3D Model Material in Godot

Whether you’re prototyping a 3D game, building a architectural visualization, or polishing a cinematic scene in Godot Engine, swapping and refining materials on your 3D models is one of the most frequent tasks you’ll tackle. A bland default gray mesh can turn into a weathered wooden crate, a glossy metal robot, or a translucent glass window with just a few material adjustments— but knowing the right process for your use case saves hours of frustration. Godot 4, the latest stable version of this popular open-source engine, offers multiple workflows to change materials, from quick one-off edits to bulk changes across an entire imported model. This guide breaks down every method step-by-step, so you can choose the approach that fits your project and avoid common pitfalls along the way.

Preparing Your 3D Model and Assets Before Changing Materials

Before you open the material inspector and start swapping assets, it’s important to set up your project correctly to avoid broken textures, missing references, or unexpected rendering behavior. Godot handles 3D materials differently depending on how you imported your model, so a little preparation goes a long way.

Organize your project files

One of the most common mistakes new Godot developers make is storing materials and textures in disorganized folders scattered across their project directory. When you later change a material, broken references can cause your model to render as the default pink error mesh, which is frustrating to debug. For best practice, create a dedicated folder structure for your 3D assets: for example, res://assets/models/[model-name]/ for the model file itself, and res://assets/materials/ for reusable material files, and res://assets/textures/ for texture maps like albedo, normal, roughness, and metallic. This makes it easy to track references and reuse materials across multiple models.

Check your model’s import settings

If you imported a 3D model from Blender, Maya, or another 3D modeling tool, Godot will automatically generate materials based on the settings you used in your modeling software by default. To edit these materials cleanly, you’ll first want to adjust your import settings:

  1. Select your .gltf, .glb, .obj, or .fbx file in the FileSystem dock.
  2. Open the Import dock that appears at the top of the editor window.
  3. Under the Materials heading, you’ll see options for how Godot imports materials. If you plan to replace all existing materials on the model, you can uncheck Generate Materials to avoid creating unused default materials that bloat your project.
  4. If you want to keep existing materials but edit them later, leave Storage set to Embed Subresources if you don’t plan to reuse the material, or Save As File if you want to edit the material separately.
  5. Click Reimport to apply your changes.

 

Have your new material or textures ready

Before you change the material on your model, make sure any new texture maps are imported into your project folder. For PBR (physically based rendering) materials, the most common maps you’ll need are albedo (base color), normal (surface detail), roughness (how matte or shiny the surface is), metallic (whether the surface is metal or dielectric), and ambient occlusion (shadow detail for crevices). Godot 4 uses the StandardMaterial3D and OrmMaterial3D for most PBR workflows, so your textures should be formatted to match the expected input for the material you plan to use.

Changing Materials on a Single Mesh Instance: The Quick Method

If you just need to change the material on a single 3D mesh in your scene, the process is straightforward and takes less than a minute. This method is ideal for one-off changes where you don’t need to reuse the material across multiple objects.

Step 1: Select your MeshInstance3D node

In Godot 4, all 3D models are made up of MeshInstance3D nodes, which hold the mesh geometry and assign materials to that geometry. Even imported models that have multiple surfaces will usually have separate MeshInstance3D nodes for each surface, or a single node with multiple material slots. To get started, click the MeshInstance3D node you want to edit in the Scene dock on the left side of the editor.

Step 2: Locate the material slot in the Inspector

With the MeshInstance3D selected, open the Inspector tab on the right side of the editor. Scroll down until you see the Geometry section, then expand the Materials sub-section. You’ll see one or more material slots listed here, labeled Material 0, Material 1, and so on. Multiple slots correspond to different material groups on your 3D model: for example, if you have a character model with separate materials for skin and clothes, you’ll see at least two material slots here.

Step 3: Assign your new material

There are two ways to assign a new material here, depending on whether you’re using an existing saved material file or creating a new material directly on the mesh:

  • If you already have a saved .tres material file in your project, simply drag and drop the file from the FileSystem dock into the material slot. That’s it—your material will update immediately on the mesh.
  • If you want to create a new material right on the mesh, click the dropdown next to the empty material slot (or the existing material) and select New StandardMaterial3D (or another material type like OrmMaterial3D for packed ORM maps). You can then adjust the material properties directly in the Inspector, drag and drop your textures into the appropriate texture slots, and see changes in real time in the viewport.

When you create a new material directly on the MeshInstance3D, it’s embedded as a subresource of the scene by default. If you want to reuse this material later on other meshes, just right-click the material in the Inspector, select Save As, and save it as a .tres file to your materials folder. This makes it easy to update the material once and have changes reflect across every mesh that uses it.

Changing Materials on Entire Imported Models or Multiple Meshes

If you’re working with a fully imported model that has multiple meshes and materials, or you need to swap the same material across dozens of mesh instances at once, the quick single-slot method is too slow. Godot offers two efficient workflows for bulk material changes that save you from editing each slot manually.

Bulk replace materials in the editor

Godot 4 has a built-in tool to replace all instances of a material across your entire scene in one click. This is perfect if you imported a model with default placeholder materials and want to replace all of them with your custom project materials. Here’s how to use it:

  1. Right-click the root node of your model in the Scene dock.
  2. Hover over Replace in the dropdown menu, then select Replace Material...
  3. In the popup window, click the Old Material dropdown and select the material you want to replace. If you have the material saved as a file, you can also drag it into this slot.
  4. Click the New Material slot and add your new material, either by dragging a saved .tres file or creating a new material directly.
  5. Check the box labeled Replace in children if you want to replace the material across all nested MeshInstance3D nodes under your root model node. Leave it unchecked if you only want to replace it on the selected node.
  6. Click Replace and Godot will automatically swap all instances of the old material for the new one.

 

This tool also works across your entire scene if you select the root Node3D or CharacterBody3D at the top of your scene tree and check the "Replace in children" box. It’s a huge time-saver for large environments with dozens of identical meshes all using the same base material.

Override materials on the entire mesh instance

Another useful trick for changing materials on a model with multiple surfaces is the material_override property available on every MeshInstance3D node. This property forces the entire mesh, regardless of how many individual material slots it has, to use a single material. This is great for things like:

  • Creating a quick solid-colored silhouette for a 3D model
  • Applying a single outline or debug material to a complex imported model
  • Temporarily replacing all materials for prototyping before you add final custom materials

To use material override, just select your MeshInstance3D node, find the Material Override property near the top of the Inspector, and assign your new material there. That’s all you need to do— the entire mesh will use your new material, ignoring all existing material slots. To go back to the original materials, just clear the material override slot, and your original settings will be restored.

Material override is one of Godot’s most underrated features for quick iteration. I use it all the time when prototyping level geometry: I can slap a single gray material on 20 different meshes in one click, then swap back to custom materials once I’m happy with the layout.

Changing Materials Dynamically During Runtime Through Scripting

In many games and interactive applications, you’ll need to change a 3D model’s material while the game is running. For example, you might want a character’s armor to change color when the player equips a new item, or a wall to change from concrete to broken stone when it’s damaged by an explosion. Godot makes this easy with GDScript (or C#, if you prefer) that lets you swap materials at any time during gameplay.

Changing a material on a single mesh via script

The simplest way to change a material at runtime is to preload both your new material and reference your target MeshInstance3D node in your script. Here’s a step-by-step example for GDScript, which works in Godot 4:

First, export a variable to reference your MeshInstance3D and your new material, so you can assign them in the editor without hardcoding paths:

extends Node3D@export var target_mesh: MeshInstance3D@export var new_material: Material

Then, add a function that swaps the material when you need it. If you just want to change material slot 0 (the first material on the mesh), the code looks like this:

func change_material(): target_mesh.set_surface_material(0, new_material)

If you’re using material override to change the entire mesh regardless of how many surface slots it has, the code is even simpler:

func change_material(): target_mesh.material_override = new_material

 

To trigger the material change, just call the change_material() function from another script, or connect it to an input event (like a button press) in the editor. When the function runs, the material will swap instantly.

Swapping materials across multiple meshes at runtime

If you need to change materials across multiple meshes at once— for example, changing all materials on a player character when they switch outfits— you can use a loop to iterate through all the MeshInstance3D nodes in a group or under a parent node. This example swaps all instances of an old material for a new material across all child nodes of the root node:

@export var root_node: Node3D@export var old_material: Material@export var new_material: Materialfunc change_all_materials(): # Iterate through all children recursively for mesh in root_node.find_nodes_by_type(MeshInstance3D): # Check each surface material slot on the mesh for i in range(mesh.get_surface_count()): if mesh.get_surface_material(i) == old_material: mesh.set_surface_material(i, new_material)

This approach is perfect for complex models like characters, which can have 10+ separate mesh instances for different body parts, clothing, and accessories. Instead of assigning each new material manually, you can loop through them all in a few lines of code.

Modify existing material properties at runtime

You don’t have to swap entire material files to change the look of a 3D model at runtime. You can also modify the properties of an existing material directly, which is more efficient than swapping the entire material for small changes. For example, if you want to change the albedo color of a material when the player clicks on it, you can do that without creating a whole new material:

@export var target_mesh: MeshInstance3Dfunc change_color(new_color: Color): # Get the current material from the first slot var current_material = target_mesh.get_surface_material(0) as StandardMaterial3D # Check that the material is the right type if current_material: current_material.albedo_color = new_color

This is a much more performance-friendly approach for things like dynamic lighting, damage tints, or customizable player colors, since you don’t have to load a whole new material into memory. Just keep in mind that if you modify a material that’s used by multiple meshes, all meshes that use the material will be affected— because they all reference the same material resource. If you want to modify only the material on one mesh without affecting others, you’ll need to make a unique copy of the material first using duplicate():

var unique_material = current_material.duplicate()target_mesh.set_surface_material(0, unique_material)unique_material.albedo_color = new_color

Troubleshooting Common Problems When Changing 3D Materials

Even if you follow the steps correctly, you can run into common issues when changing materials in Godot. Here are the most frequent problems and how to fix them quickly:

My model shows up pink after changing materials

Pink is Godot’s default error color for missing resources. If your model turns pink after changing a material, the most common cause is a broken material reference. This usually happens when you moved or deleted the material file after assigning it to the mesh, or you didn’t properly import the texture files the material uses. To fix it:

  1. Select your MeshInstance3D node and check the material slot in the Inspector. If the slot says [Empty] or Missing Resource, you just need to reassign the material from your project files.
  2. If the material is assigned but still pink, open the material in the Inspector and check all texture slots. If any texture slots say Missing Resource, reassign the texture file from your textures folder.
  3. If you’re using a relative file path in a script, double-check that the path is correct. Remember that all paths in Godot start with res:// for project files, and user:// for saved files.

 

My new material doesn’t show up on part of the model

If part of your model still has the old material after making a change, the problem is almost always multiple material slots or multiple mesh instances. Most complex 3D models have multiple surfaces that use different material slots, so you need to change each slot individually. If you have multiple MeshInstance3D nodes under a root node, you’ll need to change the material on each one, or use the bulk replace tool we covered earlier to swap all instances at once. If you want one material for the entire model regardless of slots, just use the material override property— that will force the whole mesh to use your new material.

The material looks different in the game than it does in the editor

This is a common issue related to gamma correction and texture import settings. If your textures look washed out or too dark when you run the game, check your texture import settings: select the texture file, open the Import dock, and make sure the Color Space setting is set to sRGB for color maps (like albedo) and Linear for data maps (like normal, roughness, and metallic). If you have this reversed, your colors will look wrong in the final game. Another common cause is different lighting settings between the editor and the game: make sure you didn’t turn off any lights or change exposure settings in your scene that affect how the material looks.

Changing materials at runtime causes lag

If you’re swapping materials frequently during gameplay and notice performance drops, the most common cause is loading materials from disk every time you change them. To fix this, preload all your materials when the node initializes, instead of loading them on demand when you need to swap. Use preload() instead of load() in GDScript, so the materials are loaded into memory when the scene starts, not when you need to use them. If you’re modifying material properties a lot, consider using a ShaderMaterial with uniform variables instead of swapping entire materials, which is much more efficient for dynamic changes.

Conclusion

Changing materials on 3D models in Godot is a simple skill once you understand the different workflows for different use cases. For quick one-off changes on a single mesh, assigning a new material directly to the surface slot in the Inspector is the fastest method. For bulk changes across entire imported models or multiple meshes, use Godot’s built-in replace tool or material override to save time. If you need to change materials dynamically during gameplay, a few lines of GDScript let you swap materials or modify properties on the fly to create interactive experiences. By preparing your project files correctly and following the troubleshooting steps for common issues, you can avoid the frustrations that trip up new developers and focus on creating great-looking 3D content.

Whether you’re a beginner just learning 3D in Godot or an experienced developer working on a commercial game, mastering material management will help you iterate faster and keep your project organized. Start with the methods that fit your current task, and experiment with different workflows to find what works best for your project.

godot3d modelinggodot tutorialgame developmentgodot materials