- Home /
How to flip parent without flipping child game object?
Im quite new here and don't know how to do this. I've tried adding scripts to the child game object, rotating them in player controll script and ect. here is the code i use
void flip(){
faceRight = !faceRight;
Vector3 scale = transform.localScale;
scale.x *= -1;
transform.localScale = scale;
}
If your doing this not via transform.localScale I would appreciate if you left the full function code
Any help would be appreciated!
Children will always take on the property of the parent. You could flip the parent and then flip all the children back. Unparent the children, flip the parent and then re parent them or don't have them as children, perhaps create an other GameObject which has both the parent and children as children ins$$anonymous$$d.
I agree with karljj. Add an empty gameObject and have your current parent and children as children of the new gameObject, then just have the script to flip on the parent object.
Your answer
Follow this Question
Related Questions
How can I make a collision sensitive teleporter for a 2D game #c 1 Answer
I am making a 2d game and I want to make it where to can pick up bricks with your mouse 3 Answers
Unity 5.1.1 Transform Lag/Bug 0 Answers
Is there a solution to when colliders bypass? 2 Answers
Inverting Position on One Axis 0 Answers