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

Animating triggers - creating a death trap


In this recipe, we will animate a trigger position and use it to create a death trap. You can use Unity's Animation View to create various game play mechanisms with minimum scripting.

Getting ready

Before we start, you should prepare a death trap model. We are using a "press trap" as an example. It contains two identical moving elements. See the following screenshot:

The model is not skinned and has no rig; instead, the moving elements are separate objects. We will animate them with Unity's Animation View. You can also use the example Unity project provided and go to the Chapter 02 Working with the animation view\Recipe 06 Animating triggers - creating a death trap directory. You will find an Example.unity scene there. If you play the game, you can see the trap working. If you open the scene, you will find the Trap game object with the LeftTrap and RightTrap game objects as its children. Those child objects are the only ones animated in this example...

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