Godot Version
4.3
Question
Imagine you have 100 items in an RPG game. These items will have its own HUD Icon and 3D Model. With 100 items, having 100 classes and manually mapping the 2D icons and 3D models to each class will not make sense.
Reading around, I’ve found Make Inventory System in Godot | gameidea so using composition design pattern should be the way to go. But the tutorial is for a 2D case and is displaying just icons.
So for 3D case, suppose I have 100 3D model files in GLB format already exported from Blender, how would I “create” the 3D item in code with only one class? ie. I have an array of 100 paths to all the 3D model files, so if I create an 3D Item scene which has a MeshInstance3D, how would I load the 3D model to the MeshInstance3D during runtime in this case? Or do we not do it this way?