Sure Target should work. Sure Target allows you to pick a target/3D layer and go from one layer to the next regardless of if it’s static or not, but for some reason that is not the case try this.
Create a null object
Create a camera and parent the camera to the null.
Separate the dimensions of the null position for more control.
Create a Slider Control and set the max value to 1 less than the amount of planets you have.
var Mars = thisComp.layer("Camera Control").effect("Layer Control")("Layer"); //Create a Layer Control in the null object or pick whip each planet position and put it in a variable.
var control = thisComp.layer("Camera Control").effect("Layer Control 2")("Layer"); //Create a Layer Control in the null object for this layer or get this layer position.
var Earth = thisComp.layer("Camera Control").effect("Layer Control 3")("Layer");
var arrList = [control, Mars, Earth]; //Put all of the variables of the planets and the null object in this array.
var planetAmount = arrList.length;
var slider = thisComp.layer("Camera Control").effect("Layer List")("Slider");
var prevTarget = Math.floor(slider); //This will get the previous target number in the array in slider
var nextTarget = Math.ceil(slider); //This will get the next target number in the array in the slider
var sliderLimit = Fslider === planetAmount - 1 ? 0 : 1; //This will prevent slider from going beyond the array object.
var prevTargetPos = arrList[Fslider].transform.position.value; //If you choose to pick whip the position of the planets then get rid of transform.position.value and do the same with nextTargetPos
var nextTargetPos = arrList[Fslider + sliderLimit].transform.position.value;
linear(slider, prevTarget, nextTarget, prevTargetPos, nextTargetPos);
If you want a sudden zoom from one parent to the next, then use the Math.floor() method on the slider in the linear method.
Rather you chose to pick whip the planets and null’s position or use the Layer Control, stick with that one choice for all of the planets and null variable or else the code will break.
For Expression Tutorials:
https://www.youtube.com/channel/UCe77szX2n1WSKsGs-2gmbDw