There's more...

In the FlockDecoration.cs script, we also try to desynchronize the animations of our birds. We do it in the Start() function for every bird by setting the speed variable in its Animator to a random number:

        for (int i = 0; i < birds.Length; i++) 
        { 
            Animator anim = birds[i].GetComponent<Animator>(); 
            anim.speed = Random.Range(0.8f, 1.3f); 
        } 

That makes the birds play their animations with randomized playback speed. We could randomize it further by creating multiple versions of FlyInCircles and Idle animations. Then we would have to randomly choose currently played animation (see the next recipe for details).

In the Import settings of our FBX file, in the Rig tab, we also checked the Optimize Game Objects option. This makes our rig hierarchy (bones) invisible in the Hierarchy and reduces the number of game objects Unity has to handle.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.194.230