I have imported a blender file, and placed the Import (along with its child mesh, of course) in “Assets/Resources/Models”.
Is it possible to assign the mesh directly from script, without first making a prefab containing the mesh?
I have imported a blender file, and placed the Import (along with its child mesh, of course) in “Assets/Resources/Models”.
Is it possible to assign the mesh directly from script, without first making a prefab containing the mesh?
I guess this should do it.
Mesh mesh = (Mesh)Resources.Load("path",typeof(Mesh));
GetComponent<MeshFilter>().mesh = mesh;