- Home /
Detach children problem
Hello, I make a project with unity3D and metaio SDK. I have a problem with detach children function.
I have a parent object. this object have a child. During my game, I need to detach this children. But when I do that, the children object have a wrong rotation. Before detach children, the parent have a scale on X to -1.
How can I have the good rotation after detach children,
Here a part of my script attached to the parent:
Vector3 scaleTmp = obj.transform.localScale;
posTmp = obj.transform.position;
rotTmp = obj.transform.rotation;
transform.DetachChildren();
obj.transform.position = posTmp;
obj.transform.localScale = scaleTmp;
obj.transform.rotation = rotTmp;
thank you
Comment
Your answer
Follow this Question
Related Questions
Apply materials or components to children? 1 Answer
How do I make a hole in an object's geometry? 2 Answers
Seperating hulls in mesh 0 Answers
Calculate a spline with start- and endpos 0 Answers
[noone knows] substitution for EdgeCollider2D.OverlapPoint ? 0 Answers