Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Creating a day and night cycle with the Animation View


In this recipe, we will create a simple day and night cycle animation using the Animation View.

Getting ready

We are going to create this recipe from scratch in Unity, so we don't need any additional assets. You can also use the provided example Unity project and go to the Chapter 07 Special effects\Recipe 10 Creating a day and night cycle with the animation window directory. You will find an Example.unity scene there.

 

Open it and play the game to see the effect.

Simple day and night cycle

How to do it...

To create a day and night cycle with the Animation View, follow these steps:

  1. Create an empty game object and call it DayAndNight.
  2. Create another empty game object, call it SunAndMoonPivot, and parent it to the DayAndNight game object.
  3. Create two more game objects, SunPivot and MoonPivot, and parent them to SunAndMoonPivot.
  4. Then create the Sun and Moon objects and parent the first one to SunPivot and the second one to MoonPivot.
  5. Lastly, create...
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik