To be able to detect hits for different body parts, follow these steps:
- Import your character with all the necessary animations to Unity. Place it on the scene.
- Create a new Layer and name it BodyParts. To do so, go to the Layers menu and choose the Edit Layers option, as shown in the following screenshot:
Adding a new Layer
- Create a new script and name it BodyPart.cs. Create only one public string bodyPartName variable in this script. We will use it as a dummy script for our body parts. You will be able to implement custom effects of given body part hits in this script layer.
- Create an empty game object and name it