Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x Animation Cookbook

You're reading from   Unity 5.x Animation Cookbook An advanced solution to all your Animation problems

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785883910
Length 328 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Maciej Szczesnik Maciej Szczesnik
Author Profile Icon Maciej Szczesnik
Maciej Szczesnik
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Working with Animations FREE CHAPTER 2. Working with the Animation View 3. 2D and User Interface Animation 4. Character Movement 5. Character Actions and Expressions 6. Handling Combat 7. Special Effects 8. Animating Cutscenes 9. Physics and Animations 10. Miscellaneous

Using cloth


In this recipe, we will create a simple cloth simulation:

Cloth simulation used to create a flag

Getting ready

For this recipe, we need a model of the cloth. It should be a plane divided several times to have enough vertices for the cloth simulation to work. In our example, we use one additional model: the flag pole. You can go to the Chapter 09 Physics and animations\Recipe 01 Using cloth directory. You will find a FlagPole game object in the Example.unity scene there. This object contains the Flag and the FlagPole objects as children. The Flag game object uses the cloth simulation.

How to do it...

To use cloth simulation, follow these steps:

  1. Place the Flag game object in the scene.
  2. Add the Cloth component to the Flag game object (go to ComponentPhysicsCloth).
  1. Notice that a Skinned Mesh Renderer component is automatically added. You may remove the Mesh Renderer component from the object.
  2. Find the mesh of the Flag and drag it to the Mesh field in the Skinned Mesh Renderer component...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime