Im making a 3rd person 3D game. I have a little capsule shaped player controlled drone at the moment that moves on a flat surface. Y axis is locked. The Game object contains a script and then the child objects which are the actual body parts. If i attach a rigidbidy to the root object i get crazy results. The drone collides with something and starts to spin and then forward becomes some upward direction.
Somehow i would like to be able to use the pysics collision and ragdoll effects but still be able to maintain the keyboard movement. I guess that id have to animate the drone getting back up again when fallen.
Movement code
void CheckForKeys ()
{
if (Input.GetKey(KeyCode.W)) {
transform.Translate(Vector3.forward * Time.deltaTime * walkingSpeed);
}
if (Input.GetKey(KeyCode.S)) {
transform.Translate(Vector3.back * Time.deltaTime * walkingSpeed);
}
if (Input.GetKey(KeyCode.A)) {
transform.Rotate(Vector3.up * Time.deltaTime * rotatingSpeed);
}
if (Input.GetKey(KeyCode.D)) {
transform.Rotate(Vector3.down * Time.deltaTime * rotatingSpeed);