Create Prefab from some gameobects

Hi, I’m sorry but my english is not good.

I want to create prefab from my FBX, but i don’t need to all objects from FBX.
And I must take only those object that I need and then create prebaf, plees help.

Try to find a tutorial on creating a prefab. Basically, you bring your object into the scene editor, fix it the way you want, make a folder, and drag it into the folder.

Thanks, but I know this.
I want to do this using script. How to create single prefab I khow, but I dont know how to create hierarchical prefab using script, maybe you prompt me about it?

You can use the editor class PrefabUtility.CreatePrefab to turn an object hierarchy into a prefab from script.

http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.html

So you’d assemble your game object’s hierarchy using various instantiate calls, setting the transform.parent value of newly instantiated object to which ever game object represents the parent and then call the CreatePrefab function.

BBPHarv, maybe you write an example how to create hierarchy prefab using this documentation. I’m not find in this documentation how to do this.

It’s quite difficult to give a specific example of how to build an object as each object is unique to each game so I’ve banged out a little ditty that makes a simple game object with two transforms that might represent a monster in a game. Our monster has a main body transform called Monster and to that we’ll add a teeth game object and parent that to our monster’s main body. Since my monsters are so scarey I’ll not shock the player too much by providing mesh visuals but in your game you might want to add some functionality meshes and textures and so forth see the provided code for where / how to put them in.

function Start()
	{
	makeGameObjectHierarchy();
	}

//create an object hierarchy with two transforms.. one parented to another.
function makeGameObjectHierarchy()
	{
	//create two gameobject transforms .. This could be done using various methods
	//including object instantiation of prefabs

	var myMonster : GameObject = new GameObject("Monster");
		//We now have a blank "monster" object which could be filled using
		//myMonster.AddComponent to make what ever functionality we need
		//mesh,textures and so forth.

	var myMonstersTeeth : GameObject = new GameObject("BigerTeeth");
		//same deal here.. we have a blank gameobject to fill with meshes,textures,etc..

	//make the teeth gameObject a child of the monster
	myMonstersTeeth.transform.parent=myMonster.transform;

	//make a monster prefab
	makePrefabFromHierarchy("NewMonster",myMonster);

	}

//create a named prefab in the Assets folder of the objHierarchy
function makePrefabFromHierarchy(newPrefabName : String, objHierarchy : GameObject)
	{
	PrefabUtility.CreatePrefab("Assets/"+newPrefabName+".prefab", objHierarchy, ReplacePrefabOptions.Default);	
	}

Thank you very much, I’m understand my mistake, for any objects I do: PrefabUtility.CreatePrefab.
Now I have a good result but I lost an animation, but I think it is not very big problem.
Thanks again