Using the TimeOfDay object to generate events
Torque 3D allows us to set up an automatic day/night cycle for our game's level, which will control either a Sun
instance or position of the sun in the sky of a ScatterSky
object. We may also create events that are triggered at specific
times of the day.
In this recipe, we will set up a TimeOfDay
object and use it to control the sun and lighting of a ScatterSky
object, as well as trigger an event at a particular time.
Getting ready
We will be using a project based on the Torque 3D's Full
template using the Empty Terrain
level. If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the Full
template. It can be found under the My Projects
directory. Subsequently, start our new Full
template game and load the Empty Terrain
level.
How to do it...
In the following steps, we will add a TimeOfDay
object to the level and have some events be triggered by it:
Press F11 to open the World Editor. As we want to...