I gave a planet and a sun how can i make planet orbit around the sun. I have trouble orbiting the planet around the sun. If you have an a example of something orbiting something please share it. Thanks.
This , is difficult. You should take a look at orbital mechanics first so that you can understand how orbits work , from this you can create an eccentricity ,highest and lowest points on the orbit. Then look at Oval generating algorithms. If you are looking for a simple circle just do a basic rotation around the sun.
So how ?
Kepler’s.
Well unfortunatly not everyone knows orbital mechanics, google it youll find something.
I’d say: Do you really want to know anything about orbital mechanics? Probably not: Use a parameterized circle, ellipse or Kepler’s and call it a day.
I think that you can combine some trig, keplers, and an ellipse to provide a realistic orbit. Just make the object follow the ellipse and speed up the closer it gets to the parent.