- Home /
Question by
Pauls · Sep 02, 2013 at 03:52 AM ·
gameobjectcharacterdestroyhead
Replacing object: first object not completely destroyed?
Hi,
EDIT:
or I could import the mesh without some parts of the mesh, and add them as being the child of one bone. I will try this.
I would like to replace the head of my character with another mesh, but with the code, the first head is not completely destroyed, the neck seems to want to connect to a point in the world. The cube is the new head :
Would you know why it does this?
Here is the code :
void Update () {
if ( Input.GetKey("r") ) rIsTrue = true;
if ( rIsTrue ) {
cube.position = head.position;
Destroy(head.gameObject);
cube.parent = GameObject.Find("neck").transform;
rIsTrue = false;
}
Thanks
head.png
(20.5 kB)
Comment