I decided to make this post because of returning the internet what it gave to me when searching for information when making the game. Every tutorial I found through the net was totally free and I think this will help other people to their projects as those tutorials helped me.
First will show you the process of dismembering in a video with few steps, then will explain how I achieve this.
I simply came across with the idea of making the dismembering in that way because is very easy to implement. Another discussion is when you have cloths attached, that makes things more complicated.
- Create a basic mesh with their armature.
- Separate the body parts you wish for the dismembering effect
3- Add joints and colliders to the character
4- This point is the key. Create the dismembered parts of the model to a different armature. You have to keep only the dismembered skinned renderer mesh and delete the colliders that do not belong to the dismembered part.
5- Create a dismembered script part which you have to:
5.1- Have a gameobject which will handle the dismembered part.
5.2- Hide the dismembered part at the start
5.3- Have a function that enables the hidden dismembered part, copy the position and the rotation from the original to the dismembered part, and disable the original part.
6- Create a script in a sword and manage the OnCollisionEnter function that will do the following:
6.1- Check if the collisioned gameobject has the dismembered script, if it does, call the function to dismember the part!
This is the sickest effect I am proud of!
The following link will lead you to download the SimpleDismembering project, wishing to be useful in your projects!