Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

How to Load a Default Resource (Mesh)

Discussion in 'Scripting' started by TheHobbyist, Nov 13, 2019.

  1. TheHobbyist

    TheHobbyist

    Joined:
    Nov 24, 2014
    Posts:
    11
    I see the resource in this path if I add set the mesh in the Editor, but I would like to load it at runtime.

    meshFilter.mesh = Resources.Load("Library/unity default resources/Cube") as Mesh;

    I do not want to use CreatePrimitive because it creates a new object with a collider, and it will generate a bunch of events since it overlaps with a collider on an existing object.

    Thoughts?
     
  2. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,021
unityunity