Building an earth-moon system
Let's add the moon and animate it to orbit the earth. We will organize this in the hierarchy under a new container object that we'll call Earth-Moon
. This way, we can keep the earth and the moon together so later we can move them as a unit (a celestial pair) when they orbit around the sun.
You may wonder why not just make the moon a child object of the earth so they'll move together around the sun? Well, the earth also spins its day-night cycle, and we don't want the moon to inherit that angular rotation, so its orbit is separate.
Creating the container object
First, let's create the Earth-Moon
container:
- In
Hierarchy
, create a new empty object underSolarSystem
, namedEarth-Moon
and reset itsTransfor
m
. - Move
Earth
as a child ofEarth-Moon
. - Set their positions as follows:
SolarSystem
(0
,0.75
,0
),Earth-Moon
(0
,0
,0
), andEarth
(0
,0
,0
).
The resulting hierarchy is shown in the following screenshot:
Creating the moon
Next, we can create a Moon
object from sphere
. We...