I'm using death animation for my enemies but the problem is that when enemy dies he crosses the walls/world. I want enemy/animation to be pushed back into world when he dies (animation is playing). Currently all my enemies (contains skeleton, gun mesh & enemy mesh) are rigid-bodies (kinematic) with character controller and all walls have mesh collider attached to them. I have turned on animatePhysics for enemies but there is no effect. HELP? What am I doing wrong?

  • \$\begingroup\$ Are you saying you want your characters to ragdoll when they die? Have you looked at this: unity3d.com/support/documentation/Components/… \$\endgroup\$ – Tetrad Jan 5 '12 at 7:12
  • \$\begingroup\$ @Tetrad No i just want to play simple animation which should stay in world when enemy dies. \$\endgroup\$ – 2600th Jan 5 '12 at 7:16
  • \$\begingroup\$ @Tetrad i just noticed that my character controller doesn't move with animation. However on adding another collider to skeleton this collider moved with animation but still there is no collision with wall. I'm still not able to figure out the problem. \$\endgroup\$ – 2600th Jan 5 '12 at 15:02
  • \$\begingroup\$ You can't just add a collider to a skinned mesh and expect it to work as is. You really have two options: 1) ragdoll or 2) no ragdoll, and accept that your model is just going to exist wherever your character collider is when it dies and it's going to clip. \$\endgroup\$ – Tetrad Jan 5 '12 at 16:42
  • \$\begingroup\$ Thanks however i will stick to option number 2 for the time being. \$\endgroup\$ – 2600th Jan 6 '12 at 5:36

Look at any triple A quality game, and most of them accept that it is impossible to keep all the bodies out of all the geometry. Why? It is expensive to calculate. If your game is looking ugly because of this, try to precache the space needed for the dying animation, and use the data to move the player away from geometry if needed. Be warned stuff like this will often cause new glitches in funny situations like corners, causing more pain than fun.

  • \$\begingroup\$ It's not looking ugly but you must know the feel one gets when it's not good enough... Thanks \$\endgroup\$ – 2600th Jan 6 '12 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.