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.
2 Answers
\$\begingroup\$
\$\endgroup\$
3
- Import the mesh into Unity
- Select the prefab you want to modify in the Project Window
- 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.
-
\$\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\$– HakanaiCommented Mar 2, 2018 at 8:12
-
\$\begingroup\$ It works for changing the mesh. Change the animation in a similar fashion. \$\endgroup\$– HouseCommented 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\$– HakanaiCommented Mar 4, 2018 at 2:56
\$\begingroup\$
\$\endgroup\$
1
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:
- Drag prefab into scene
- Change the mesh in the MeshFilter component of the sub-object
- Click on the main object of the prefab
- Click "Apply" in the inspector
- Delete prefab from scene
-
1\$\begingroup\$ +1 This strategy works when the MeshFilter is at any depth. \$\endgroup\$– HouseCommented May 2, 2016 at 20:20