Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
Are you saying you want your characters to ragdoll when they die? Have you looked at this: unity3d.com/support/documentation/Components/… –  Tetrad Jan 5 '12 at 7:12
    
@Tetrad No i just want to play simple animation which should stay in world when enemy dies. –  2600th Jan 5 '12 at 7:16
    
@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. –  2600th Jan 5 '12 at 15:02
    
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. –  Tetrad Jan 5 '12 at 16:42
    
Thanks however i will stick to option number 2 for the time being. –  2600th Jan 6 '12 at 5:36

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
It's not looking ugly but you must know the feel one gets when it's not good enough... Thanks –  2600th Jan 6 '12 at 5:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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