Tutorial 0 – Overview

  1. Begin with an empty scene
  2. Create a GravityEngine (GameObject/3D Object/GravityEngine)
  3. Create a Star:
    1. Create an empty game object and name it “Star”
    2. Add an NBody component (Add Component/Scripts/NBody). Set the mass to 1000
      1. This script ensures the gravity engine controls this object. It provides the values for mass and initial velocity.
      2. The Transform component now changes to show only the position. Orbits in the gravity engine asset use hierarchy and this relies on a scale of 1 in the transform element.
  4. Create a model for the star (Game Objects/3D Object/Star)
    1. Make this a child of the Star with local position (0,0,0)
      1. Making the model a child allows the size of the Star to be adjusted without adversely impacting the scaling of other children.
    2. Add the Solar Texture as a Material
    3. Adjust the size to (5,5,5)
  5. Create a planet (Repeat 3 and 4 naming the object “Planet”).
    1. Give the planet a mass of 5
    2. Add a material e.g. Ganymede from PATH_HERE
  6. Add an OrbitEllipse component to the Planet.
    1. This script defines orbital motion around a specified body. It will automatically select a parent object as this body.
  7. Make the planet a child of the Star.
  8. Look at OrbitEllipse in the Inspector and scene view
    1. Set the “Semi-Major Axis” to 10
    2. Experiment with the orbit attributes and observe how they change in the scene view.
  9. Press play to see the planet orbit the sun
    1. Can adjust the camera settings to see the orbit (z=-30)
    2. Change camera settings to a background with a solid color if you wish.
  10. Create an empty game object “DustRing”
  11. Add a particle system
    1. Duration=999
    2. Start lifetime=999
    3. Start Speed=0
    4. Emission Rate=0
    5. Emit as a burst of 1000 at time=0
  12. Add a GravityParticles script to DustRing object.
    1. This script indicates the Gravity Engine will control the particles.
  13. Add a DustRing script to DustRing object. This controls the initial position and velocity of the particles.
    1. Add a material (e.g. BlueMat at PATH)
    2. Adjust the orbit to the desired size and shape.
  14. Make the DustRing object a child of the star.
  15. Press play to see the dust ring and planet.