[SOLVED] Cant add material to FBX model

Error in editor: “Uncaught TypeError: Cannot set property ‘material’ of undefined”


I cannot add a material to the model. I dont know why.
Maybe its an export error, but i dont know what to tell the client to solve it.

Thanks in advance.

It looks weird. Try to re-export the model in FBX format from a 3D editor.

1 Like

I open it in blender, put it a “Paint Slot”, and re-export it.

Now i can texture it, but all the instances share the material. Still weird.
The material is atached to the .json of the model and not the instanced model

Note: I dont have experience with modeling.

Update 2. I pressed “entity material” and that worked.

Seems that adding a Paint Slot in blender, and re-exporting it worked.

The FBX format is converted to the json format, which stores the coordinates of all points to perform model triangulation.

You can paint a model in Blender, for example, in diffuse, and then when you import into the game editor, will have created material. If you do not paint the model in Blender, then you can create material in the game editor, apply it to the model and apply a map, for example the same diffuse. If you are making a complex texture, then you need to do a uv mapping in Blender for the correct texture mapping.

1 Like

Yes, the weird part was that if i didnt export the FBX from blender with a material. It would not let me add one in the editor.

I’m not good at 3D modeling, but as far as I know, when you create a model in Blender, you also create material for this model. It is possible that you have deleted this material, so there was a problem.

1 Like

Thanks, my knowledge of modeling is really superficial. I am coder.
Now i cant tell my client, that he should export the model with the material, Knowing that works.

Again, thanks for your time.