Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Import obj file with material applied during runtime

Discussion in 'Scripting' started by harry0647, Nov 17, 2020.

  1. harry0647

    harry0647

    Joined:
    Sep 8, 2020
    Posts:
    10
    Hello,

    I'm trying to import obj file into the scene. Currently, I'm using this, however, while I can import an object, it does not come with texture. I followed the guideline of adding Standard (specular) to always include shaders. Here are the files I try to import: .obj and .mtl file in .zip and the texture map (can't upload due to its size so I use the link, can be downloaded there). The only change I did is to change Tr 1.00000 to 0.00000 in .mtl file since the loader is inverting Tr to d and 0 in d can't be seen.

    Could anyone tell me what I need to do or perhaps another way of importing .obj in runtime? Thanks in advance.
     

    Attached Files:

  2. FlashMuller

    FlashMuller

    Joined:
    Sep 25, 2013
    Posts:
    449
    It doesn't come with the texture or you can't assign a material?
    I would simply ask the dev as the package states that it does import Textures, to be honest.
     
  3. harry0647

    harry0647

    Joined:
    Sep 8, 2020
    Posts:
    10
    I found another obj loader and end up using that as it works, but could you explain what's the difference between import textures and assign a material?