2
\$\begingroup\$

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?

\$\endgroup\$
5
  • \$\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, 2012 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, 2012 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, 2012 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, 2012 at 16:42
  • \$\begingroup\$ Thanks however i will stick to option number 2 for the time being. \$\endgroup\$
    – 2600th
    Jan 6, 2012 at 5:36

1 Answer 1

1
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\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, 2012 at 5:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .