This project is a 3 week project made for my game portfolio class. The form of this particular project shifted quite a bit as it went on, and I ended up with a multi-part final product. My main focus here was ragdoll physics simulation, something I've done a lot of work on before but wanted to try out in Unity.
When I started this project, my goal was to create a ragdoll physics simulator in Unity. I spent the first week largely doing research – I had done ragdoll before; it was the Unity part that I needed to figure out. In doing said research, the main obstacle I faced was the discovery that Unity already has a “ragdoll wizard” so finding any info on doing it myself was difficult. Around week two, after some more looking into Unity’s ragdoll system, I shifted the goal of my project a bit. At this point, my goal became to replicate the ragdoll effect Unity’s wizard creates with a non-humanoid mesh.
To start this process, I downloaded a few free assets – a humanoid figure to allow me to look at Unity’s ragdoll wizard, and a horse model to start working on myself. I proceeded to work on setting up this horse’s ragdoll, which involved a lot of individual colliders for each bone.
Unity's character joints - the type of joint I was using for this project - give you a lot of flexibility in the type of movement a joint can have. This lets you have a lot of control over which angles different joints can move at, however it also means going through each joint in a skeleton can become very tedious.
Around week 3, as I got the rigidbodies and joints set up I eventually discovered some interesting mesh distortion problems. I believe the source of these problems was the configuration of the joints, and I did start working on fixing that problem. However, at this point the process of going back through and guessing at numbers for each joint on the horse became quite tedious, and I wanted to see what else I could do with Unity’s joint system.
For the last part of this project, I decided to make a slightly different ragdoll in the form of a snake. I found a free snake model asset and got to work. The snake is made up of sections, each of which have colliders and rigidbodies and are connected by joints. I then put together a script that checks for rigidbodies via a raycast from the camera based on the mouse position, and if it finds one lets you drag the snake around the screen. Because of how the ragdoll is setup, some chaos ensues.