shouldn't a relative_x += cos(time *frequency)*magnitude work better for spiraling instead of orbiting?
I have this for my unity 3d game (posting because orbiting is exactly what I did before this dawned on me);
public static void clockrotator(GameObject obj, float _rotratex, float _rotratey, float _rotrad){ obj.transform.Translate((new Vector3( obj.transform.position.x - Mathf.Cos(Time.fixedTime * _rotratex) * _rotrad, obj.transform.position.y - Mathf.Sin(Time.fixedTime * _rotratey) * _rotrad, obj.transform.position.z) - obj.transform.position) * Time.deltaTime); }