Stumbled upon an easier way to assign textures at runtime to an FBX/glTF in #Godot4 so I decided to give it a little write-up:

https://forum.longplay.games/t/dynamically-assigning-materials-by-name-in-godot-4-5/415?u=miguelb

#IndieGameDev #GameDev

Dynamically assigning materials by name in Godot 4.5

There’s a few different ways to assign specific materials to an FBX or glTF object in Godot 4.5.2 (and presumably newer). You can simply make the object “local”, then you can go through and assign each surface override like so: var _mat = load(MatSet[Mat0]) $Spectre/SM_SpectreEngines_00/SM_SpectreEngines_00a.set_surface_override_material(0, _mat) $Spectre/SM_SpectreEngines_00/SM_SpectreEngines_00b.set_surface_override_material(0, _mat) ... etc This definitely works if you already had to make...

Smugglers of Cygnus Forum