dettach children does not work.. ...try to null parent...

private var henry;

function Start () {
henry = GameObject.Find("henry");
}

function OnTriggerEnter (other : Collider) {
henry.transform.parent = transform;
}

function OnTriggerExit (other : Collider) {
Debug.Log("glugluglu");
henry.transform.parent = null;
}

henry.transform.parent = null; is not doing anything… how do you detach children from its parent?

Mike

i haven´t saw DetachChildren() function… i will try with that…

oops, does not work… strangely the OnTriggerExit does not works, but when i comment the “transform.DetachChildren()” or “henry.transform.parent” works again…

what i want to do is a moving ramp… player jumps into this ramp, but to avoid player falls when ramp is moving, i must to make child of ramp so player moves with ramp… some trick?

thanks.

solved…!

i don´t understood why… but i changed OnTriggerEnter to OnTriggerStay and works fine… weird…