Intercepting planet in orbit on a straight path?
Hi everyone, i'm havibg a bit of a head scratcher here.
I have the planets of the solar system moving around in orbits in "steps", basically you push a button and it advances time by a day so the planets jump by a certain number of degrees per click by doing 360 / planetspeed.
Now what I want to do is to have a spacecraft intercept an orbiting body in a straight line, but this is where i'm struggling. I have at yhe moment a gameobject that points towards a selected planet and records it eulerAngles.y, then it takes how many degrees it moves per day, then how much the spacecraft moves per day, this works out how much the planet will rotate by by the time the spacecraft reaches it, it then adds this to the planets current eulerangles and creates an intercept point.
In theory it should work, but the spacecraft either misses the planet by a large number of steps if the planet is moving away from the spacecraft or it arrives too early if the planet is heading towards the spacecraft.
I can't figure out what i'm missing...
Your answer
![](https://koobas.hobune.stream/wayback/20220612080509im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Translating TerrainData location. 0 Answers
Wrong .rotation.eulerAngles.x output 1 Answer
ScreenToWorldPoint produces two identical output for different input vecotrs 1 Answer
I need help in rotating cube by 90 degree with swipe in all axis 0 Answers
Problem with calculating potential and kinetic energy 1 Answer