Hi, I’m relatively new to Unity, and I have been working on a shooter game, yes, very original, I know.
Anyways, in the game, I would like to be able to shoot an enemy in the arm, and have the arm ragdoll when it is shot, and do same for other limbs.
I have been thinking about this, and I think I would have to apply a DamageReceiver to each limb detect hits. But then I don’t know how the rest of the body would still animate.
If I could animate a ragdoll, and then only animate the limb if it is not ‘dead’, then that might be a possibilty.
If I’m completely wrong, please, tell me. If not, can someone shed some light on this for me?
Hope someone can help.
It can be done through the Animation API (and you probably need the new stuff in 2.1), but animating only part of a skeleton is way beyond the scripting abilities of a Unity newbie - I probably wouldn’t even attempt it unless I absolutely had to.
I did something quite like this recently…
Basically, I brute-forced the process. Each and every piece of the body was separate and had its own version of the animations of the overall body.
Whenever a limb is “destroyed,” it switches to its destroyed version of each animation. For instance, when running forward, the ordinary animation has it holding the weapon and swinging back and forth. The destroyed version has it hanging loose and swinging up and down a little behind the body.
It’s not that hard to have a boolean determine the animation, and from there you just have to name each animation the same and have the master animator set the animations based on player or AI input.
This is quite a bit of work, though…
Alternatively, you could just activate the Unity ragdoll system when the limb is destroyed and apply forces based on movement. That’d work as well.
Okay, thanks. I’ll look at those and see what I can get working.