Getting ready

To follow this recipe, you need a character with one Idle animation. You can also go to the Chapter 05 Character actions and expressionsRecipe 04 Using LookRotation and SetLookAtPosition methods to make characters follow an object with their gaze directory. Open the Example.scene scene there. You will find the HumanoidLookAt and HumanoidIKLookAt game objects there. The first one uses a generic LookAt() method and the second one uses the Animator.SetLookAtPosition() function. To see the effect, play the game, switch to the Scene View, and move the Target game object around (a red shiny sphere).

Characters looking at the Target game object
..................Content has been hidden....................

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