Search Unity

How to Load a Default Resource (Mesh)

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

  1. TheHobbyist

    TheHobbyist

    Joined:
    Nov 24, 2014
    Posts:
    19
    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,304