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 object's local position - creating automatic doors


In this recipe, we will learn how to animate an object's local position to be able to use the same animated object in multiple locations in the scene. We will create another common gameplay mechanism, automatic door, as an example.

Getting ready

To make an animated door, you should have two objects ready: the Door Frame and the Door. The Door should be a child of the Frame in the Hierarchy. It should be placed in the closed position. We assume that our Door will slide upward when opening. You should also have a player character with the Player tag assigned. The character should use a Rigidbody component to move or have a kinematic Rigidbodycomponent. We will use triggers for our doors, and triggers react to Rigid bodies only. You can also go to the Chapter 02 Working with the animation view\Recipe 04 Animating objects local position - creating automatic doors directory and find the Example.unity scene there. If you open it, you...

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