Question by
SuperRaed · Feb 10, 2018 at 11:17 AM ·
rotationtransformrotatearounddeformationrotatearoundpivot
Deformation of child object when rotating around a rotatable parent object
I'm trying to create a tree like bending motion as following
so I created a pivot which is parent for main branch which is the parent of pivot for subbranch which is parent for the subbranch and so on , and using the following code
public GameObject thumbParticle,thumbParticle2;
public GameObject pivot,pivot2;
public float MaxAngle;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float angle= Input.GetAxis ("Horizontal");
pivot.transform.RotateAround (pivot.transform.position, pivot.transform.forward, angle *50* Time.deltaTime);
pivot2.transform.RotateAround (pivot2.transform.position, pivot2.transform.forward, angle *50* Time.deltaTime);
}
}
but I'm getting this deformation of child object as following
how can I solve it?
rotation.png
(8.0 kB)
Comment