Answer the question
In order to leave comments, you need to log in
Is it possible to change the Transform of an object without changing the Transform of its child object?
When you change the Position and Rotation of an object, all of its child objects change these settings along with them. Is it possible to somehow force them to ignore these commands or even freeze them for a certain period of time (or forever)
Trying to do this, I just made the child object move and turn mirror to the parent. But the result did not satisfy me, because. the child object ends up moving down a bit .
el.transform.position += new Vector3(0.05f, 0, 0);
el.transform.GetChild(0).transform.position += new Vector3(-0.05f, 0, 0);
el.transform.rotation = Quaternion.Euler(0, 0, 10);
el.transform.GetChild(0).transform.rotation = Quaternion.Euler(0, 0, 0);
yield return new WaitForSeconds(0.02f);
el.transform.position += new Vector3(-0.05f, 0, 0);
el.transform.GetChild(0).transform.position += new Vector3(0.05f, 0, 0);
el.transform.rotation = Quaternion.Euler(0, 0, -10);
el.transform.GetChild(0).transform.rotation = Quaternion.Euler(0, 0, 0);
yield return new WaitForSeconds(0.02f);
el.transform.position += new Vector3(0.05f, 0, 0);
el.transform.GetChild(0).transform.position += new Vector3(-0.05f, 0, 0);
el.transform.rotation = Quaternion.Euler(0, 0, 10);
el.transform.GetChild(0).transform.rotation = Quaternion.Euler(0, 0, 0);
yield return new WaitForSeconds(0.02f);
el.transform.position += new Vector3(-0.05f, 0, 0);
el.transform.GetChild(0).transform.position += new Vector3(0.05f, 0, 0);
el.transform.rotation = Quaternion.Euler(0, 0, 0);
el.transform.GetChild(0).transform.rotation = Quaternion.Euler(0, 0, 0);
Answer the question
In order to leave comments, you need to log in
If you need to do this, then you have problems with the hierarchy.
And in general - LOCAL coordinates of children do not change. And the fact that it has moved globally - well, common, that's why the hierarchy is needed)
But in fact - either you do as freeExec said , or you apply a reverse transformation to the child (movement / rotation / scale in the other direction by the same amount).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question