i make a gameObject as parent gameObject ,called “aircraft”, it has a child empty gameObject ,called “controller”,the controller has a child gameObject ,called “body”,the body is 3D model of the aircraft, when game start ,the parent gameObject aircraft move to forward, and i write a script control the aircraft orbit around a cylinder,and the script attach to “controller”.
i use RotateAround function to control the “controller” gameObject
myTransform.RotateAround(Vector3.zero,Vector3(0,0,-Input.GetAxis("Horizontal")),rotateSpeed);
parent gameObject “aircraft” move to forward
pTransform.Translate(Vector3.forward * mySpeed * Time.deltaTime);
when game start,everything is normal,like this
but after a while, when the aircraft rotate back on the top of cylinder,some thing is wrong,aircraft not in the center of the cylinder,like this
i don’t know why, need help