Hit object

Hi,

I would like to get some ideas on how hitting a person that causes a body part to fall off, I have for example a head that I can hit off, or even the body and it moves or flys around. How can I get the head to fall off after two or four times of having hit the head?

As for hitting the body, I guess an animation can be played to display that instead of it flying away into 3D space. But the armature is the child of the parent. So the body doesn’t animate.

I wonder what you are dreaming.

To split objects on collision you simply replace the one object with two objects. That is all.

Count the hits.

Hint: armatures are objects too. You can add/remove them on the fly. Just be aware they need individual skin meshes.

Seperate the head from the body.Then make a duplicate.Place the duplicate on layer 2.Then make the first one a actor ghost.Then parent it to your character.Here are pictures of the logic brick set up.



Hmm, in my case there is no health, just hit the head a few times and bang it flys off.

So the brick setup happens on the head? So once Arm 2 collides with it more than one once, the head will fall off.

I did what you displayed there, for the Aihead of the character, the Aihead.001 is in layer five. Nothing works.

It must be the setup of the bricks? The Aihead is the child of the Aibody.

I changed Aihead to the 001 and it does duplicate, but the parented Aihead remains.

or . . .
I think you could leave both heads on the main layer, and use the visibility actuators to turn one visible, the other invisible. suspend dynamic. then when the head gets hit, it ends, while the other becomes visible, enables dynamics, and remove parent.
Might be a little easier.
Getting it to fly off might be tricky, as it will just drop through the body.

I think you should be able to figure it out with what we have told you.If not ask.

I don’t know. I did as the images display.

The character will need a head as it will be a walking character, so the FP can move to a character and hit the character’s head four times and it should fly off, with the body then drop on the ground.

I did try Oldguy’s variaton, nothing occurs there either.

The character will be walking around, and I suppose react to be hit on the body. Or perhaps both. But for the moment, the head is the focus.

Attachments


It should work both ways.
Are your coillisions working? Sometime they don’t work for me. Can you change the collision brick to a keyboard, to test it?

You have “assign” on that property, shouldn’t it be “add” -1? When he gets hit 4 times. Then property “hit” reaches 0, it changes to state 2? the “greater than”, shouldn’t it be “equal”, or “less than” 0?

Those pics look blurry to me so I can’t see them very well.

Also, are the heads parented to the armature? When you separate a body part, (mesh only, not armature bones) then make a duplicate, the duplicate is still parented also, (child of, I should say) (that’s how I make clothes, shirts, pants, painskin, etc, for a character, then change clothes during the game)
So no need to re parent it, unless you un paranted it at some point, which you shouldn’t do in this case.

Also, on that edit object, on state 2. shouldn’t you put a little LinV, and AngV on it so the head flies off?

this may be over done, but its still worked. its a very old file of mine. “trigger warrning” very gory. lol.
sorry i just dont have the time to fix it all. its outdated. like 5 yrs old

this should help u get an idea of how to use replace mesh, and just see an over all idea of how it could be done.

The head and body are parented together. I have edited the brick setup, yes that now works after hitting a few times. Okay that seems fine. Right so now to get some fire effect gushing out of the neck, as well a body drop.

I’m not concentrating here, the head falls off, but the one in the other layer is still there. And I didn’t hit it. It just fell off.
<br>

As for the example cuervo1003, nice! But I’m not looking for any python use.

How ever can I have your texture?

your head.blend (612 KB)Here is a example blend of what you are looking for.Look at my logic brick setup and learn.Keep w pressed and see what happens.

Okay I viewed the file, yeah, er, well on mine it is still the result of touching the head with the weapon and it falls off.

The interval and Equal work. I have the hit counter at 4. So for the Equal that is 4. Eitherway it only drops off. Just animating it by hitting as seen nothing works that way.

If you have a bone in the head get rid of it.Maybe that will work.

Is the character parented to a cube or rectangle?If so make it convexhull and slant the top.

@Cuervo1003
Wow, really nice effects. Is that a “Make Human”, character? real cool. I’ll be checking out your code next on my to do list. :slight_smile:

@modlingblender

as well a body drop.

The body drop will require a ragdoll. Without a ragdoll, you can animate a body drop on the armature if your rig is set up correctly.

No, the body is the parent of the skeleton.

There is no cube. I need a cube for it then?

I tried parenting a cube, that just made the body fly away. That can’t be the answer?

I did lock the X,Y,Z. Same result. The body is the parent of the skeleton, now a cube is the child of the body.

You have to make the armature and body no collision.And keep the head actor and ghost.

The armature has no collision. As for the body, that has some kind of collision. The head in the scene is still a actor and ghost.

Hmm, the model looks like it have some normals problem.