Hi everyone,
I’d like to know if someone knows how to create a “.prefab” file from a model3D file (.fbx, .obj, .dae, etc.) dynamically by code wihout using any editor preferences or dragging gameobjects in a Prefab created specifically in Editor view. Is this possible? Thanks in advance.
If you can run your program in the Unity editor, then wccrawford’s link is useful. Specifically the PrefabUtility class.
PrefabUtility is in the UnityEditor namespace, which is not available at runtime when building to device.
At runtime, if we want to save player changes, we’ll save relevant data in a json file or PlayerPrefs then rebuild what the player made from that data at runtime using existing prefabs.