Time for action – creating the pigs
Let's get started with creating the pigs for the Angry Birds game:
The pigs are created in a manner similar to that of the the wood planks. Start by creating an empty GameObject and naming it
Pig
.Next, create a plane, make it a child of the
Pig
object, and remove its Mesh Collider component. We do this because of the rotation the plane will need to face the camera. Being a child of the empty GameObject allows us to ignore that rotation when working with the pig.Set the plane's local Position to
0
on each axis and set its Rotation to90
on the X axis,270
on the Y axis, and0
on the Z axis. This will make the plane face the camera.Now, create two materials. Name one
Pig_Fresh
and the otherPig_Damage
. From their Shader drop-down list, select Transparent, followed by Cutout, and finally Soft Edge Unlit. This allows us to make use of the the texture's alpha channel and provide some transparency.Finish off the materials by adding the
pig_damage
andpig_fresh...