5
\$\begingroup\$

So I made a prefab some time ago and now I want to change the mesh without changing any scripts. I have an OBJ file I want to use. Is there any way to do this? I've read the documentation but I don't seem to understand how to do it.

\$\endgroup\$

2 Answers 2

9
\$\begingroup\$
  1. Import the mesh into Unity
  2. Select the prefab you want to modify in the Project Window
  3. In the Inspector, select your new mesh from the Mesh Filter component

This will update the prefab and any instances you have in any scenes.

\$\endgroup\$
3
  • \$\begingroup\$ I'm guessing this doesn't work if the thing has an armature. I tried doing it and end up with a crazy mash of vertices. \$\endgroup\$
    – Hakanai
    Commented Mar 2, 2018 at 8:12
  • \$\begingroup\$ It works for changing the mesh. Change the animation in a similar fashion. \$\endgroup\$
    – House
    Commented Mar 2, 2018 at 14:03
  • \$\begingroup\$ I did change the Avatar setting to the one for the other model too, but it didn't resolve it, and there are literally no other things in the inspector which are different between the two. (There is obviously a setting which Unity isn't providing me UI for, so I can't change it, so if I edit the YAML directly, maybe I can fix it?) \$\endgroup\$
    – Hakanai
    Commented Mar 4, 2018 at 2:56
4
\$\begingroup\$

The version by Byte56 works if the mesh is on the prefab or one of its first level child-objects. When it's deeper in the object hierarchy of the prefab, you can't expand it in the project tree. In that case:

  1. Drag prefab into scene
  2. Change the mesh in the MeshFilter component of the sub-object
  3. Click on the main object of the prefab
  4. Click "Apply" in the inspector
  5. Delete prefab from scene
\$\endgroup\$
1
  • 1
    \$\begingroup\$ +1 This strategy works when the MeshFilter is at any depth. \$\endgroup\$
    – House
    Commented May 2, 2016 at 20:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .