0
$\begingroup$

I am making a space game in BGE and I need a planet to orbit around the sun without having the origin point inside the sun (this is because I want it to have a Collision bounds). How can I do this? Thanks

$\endgroup$
3
$\begingroup$

Add a circle or any other object (could be an empty) to the position of the sun and parent the planet to it. If you rotate the center object, the planet will rotate too, you can then animate its rotation via the center object's rotation (or just let it rotate on its local axis via Motion Actuator). Its important to create a new center object for every other planet so that their rotations can be different.

Object Relations:

  • Sun
  • Orbit Object
    • Planet (Origin at sun)

Example (Circles used as orbit objects for demonstration): Example

|improve this answer|||||
$\endgroup$
0
$\begingroup$

First, make a circle curve, originating from the sun, and scale so that the edge is in the centre of your planet like this. enter image description here

then, add a curve modifier in your planet, and select the circle curve. enter image description here

Now when you move your planet across the x axis, it orbits.

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Thanks, but this doesn't appear to work in the game engine. It does work in the viewport, but if I run the game engine, it just moves straight. $\endgroup$ – user53103 May 15 '18 at 17:44
  • $\begingroup$ Oh.... ill try to find something $\endgroup$ – Dragion Tech May 15 '18 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy