texture not applied, despite many attempts

Hi,

how could i apply a texture on a mesh imported in .fbx from Blender?

I have tried many ways :

  • Set the texture in Blender, being in “Object Mode”, with the “Texture” option ON, and export in .fbx

  • in Unity, add the texture in the “Textures” folder, add a mesh renderer to the imported mesh, drag and drop the texture on the mesh

  • export the .fbx with the same name as the .blend file, in the same folder where the texture is

  • in Unity, add the texture dynamically, with this code :

    var myTexture : Texture;

    function Start () {
    renderer.material.SetTexture(“_MainTex”, myTexture);
    }

and drag and drop the texture in the variable myTexture

  • restart Unity and see if anything works better… still not

Would you have any idea about this?

Thanks a lot

You need to apply the texture to a material, then apply the material to your mesh. I export FBX from 3DS Max and it will sometimes bring a material in, but there’s no textures applied to the material. I haven’t found a way to wholly import a material created in my 3D package into Unity.

To create a material, right-click on your project pane where you want to save your material, and select Create > Material.

I don’t know why, but now it works… no idea why, thanks to you guys anyway for your help!