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 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 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