Hello, I need help with instantiating a prefab and straight away parenting it to the HeadBone. Here is my current script, if it may help. Thanks in advance if anyone can help!
var HairNumber : int = 0;
var HairArray : Transform[];
var HairBone : Transform;
function Update(){
if(HairNumber < 0){
HairNumber = 1;
}
if(HairNumber > 1){
HairNumber = 0;
}
}
function OnGUI(){
if(GUI.Button(Rect(10,450,140,140),"")){
Hair();
}
}
function Hair(){
HairNumber +=1;
if(HairNumber == 1){
Instantiate(HairArray[0], HairBone.position, HairBone.rotation);
//This is where I want to parent it to the HeadBone.
}
}