- Home /
creating a procedural prefab
Hello,
let'say I have a procedural "entity" created through a script, it may be a mesh, a game level, a material or something else.
This procedural entity is created as the script is executed. Once the entity exists, is it possible to define a prefab from it? If yes, how?
Thanks.
Did you get this working? I'm creating procedural meshes and materials from an editor script, and the resulting game objects are fine -- until I turn them into prefabs, at which point my mesh and material are gone when I reload the scene.
hi yoyo, i have the same problem, send cubes to prefab via dragging and also via script... the mesh renderer and mesh filter both become unchecked/zero. ill start a question to see why making a prefab from combined objects can make the objects mesh setting vanish.
Answer by StephanK · Dec 02, 2010 at 11:04 AM
Look at EditorUtility CreateEmptyPrefab() and ReplacePrefab.