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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[C#]Find a mesh that is not in the scene

Discussion in 'Scripting' started by Nahuel3d, Jun 5, 2016.

  1. Nahuel3d

    Nahuel3d

    Joined:
    Jun 1, 2016
    Posts:
    23
    Hi
    I have a script that stores the names of some meshes that are not in the scene(They are in the assets folder)
    How can i find a mesh in my assets folder by name?
    Something like this:

    Mesh MToGet = FindMesh("car");
    SkinnedMeshRenderer.sharedMesh = MToGet;
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    LoadResource?
     
  3. Nahuel3d

    Nahuel3d

    Joined:
    Jun 1, 2016
    Posts:
    23
    Thanks a lot! i used Resources.Load and it worked. But, is it possible to load a group inside an fbx file?
     
  4. Eliotz

    Eliotz

    Joined:
    Jul 18, 2015
    Posts:
    81
    You could create a prefab out of it. I highly doubt loading something in fbx through unity is possible and it probably isn't even necessary.

    Maybe you could tell us what are you trying to do, because I'm 99% sure you can do it with just prefabs.
     
  5. Nahuel3d

    Nahuel3d

    Joined:
    Jun 1, 2016
    Posts:
    23
    Never mind, i split the FBX file in separate files for the different groups (Head, Top, Bottom, Feet)(I was making a character creator) and it loaded the files perfectly