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

Using Animation Events to draw a weapon


Another common case in combat mechanics is drawing and sheathing a weapon. In this recipe we will use Animation Events along with a Draw animation to make our character draw and sheath a sword.

Getting ready

To follow this recipe, we need to have a Warrior character with two animations: Idle and Draw. The first one is a standard, looped Idle animation. The second one is an animation in which our character reaches for their weapon in a sheath attached to the character's belt. We are not using a sheath model here to make the recipe more simple and condensed. You can open the provided example project and go to the Chapter 06 Handling combat\Recipe 06 Using animation events to draw a weapon directory. There is a Warrior character in the Example.unity scene. When you press the space bar, it will draw or sheath a sword. You can find all the necessary animations in the Rigs directory.

How to do it...

To make a character draw or sheath a weapon, follow these steps...

lock icon
The rest of the page is locked
Previous PageNext Page
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