Is there really no way to do this!?

In my FPS I want to detect an enemy is shot during real time mesh-deforming animations. Collision is detected on the un-deformed enemy’s mesh (which is great for physics). But there’s gotta be a way to register collision during real time animations. When an enemy raises their hand in the air I don’t want it to detect collision for physics, but I do want it to detect getting shot.

Without it, it makes for a very “buggy” game, like the old games where you’re constantly saying, “This game is being cheap, I know I shot him!”

2 months back I posted this problem on this thread. It was recommended to just parent separate objects to each bone, but I’m getting a little sick of doing everything in a round-about-way. Does anyone know how to detect collision during mesh-deforming animations?

This functionality does not currently exist in the Blender Game Engine with Bullet Physics. You cannot detect collisions during mesh deforming animations because the bounds of a physics mesh do not ever get reinstanced after the game starts.

There is a reinstancePhysicsMesh() function that is supposed to work with the old Sumo Physics, but Sumo is no longer supported.

For now you will need to parent separate objects to each bone (unless something changed in the SVN that I haven’t heard about yet).

As Blendenzo said: there really is no way to do this.

I was afraid of that answer. I guess a reinstance isn’t necessarily what I’d want either. I’m okay with the physics detection not changing; i just want a “hit” to be detected by the deformed mesh.

I’ll give the parent separate objects another go. How hard is it on performance to add all those extra objects?

It depends on the complexity of the armature too, if you can, avoid using IK animation and the strict minimun of bones.

I don’t think IK is possible(In GE) anyways, unless the target is a bone within the armature

And you won’t need a separate object for every bone, you could do it in 10 I think

IK is posible on GE, but buggy (when you try to do some action blending) and slow things up heavely.

Can you refresh my memory…

How do I parent an object to an individual bone, so that it is parented rather than being deformed?

Nevermind, just recalled that I need to go into pose mode first. Thanks blendenzo, Cloud_GL, and mack!

I still have a problem…

I have a mesh parented to an armature, with weight painted vertices. Then I parented a separate object to a specific bone in pose mode. The bone follows the rotation of the bone correctly, however it does not follow the position of the bone. When I press “p” and move the mesh around, the separate object doesn’t move with it…it stays in place, rotating with the armatures actions.

The reason the object doesn’t move is that the object is not parented to the original mesh, but rather the armature. The armature is not actually moving when you move the mesh, so the second object stays in the same place.

You probably need to move the armature not the mesh if you want the object and the mesh both to move with it.

I’m pretty sure it isn’t, otherwise this method would work to make armature rag dolls

Attachments

ragd.blend (145 KB)

I tried applying all my movement actuators to the armature instead of the mesh. The separate object follows the movement AND the rotations of the armature/mesh correctly now.

However, new problem…
Any object that is parented doesn’t seem to react to anything (ie sensor: touch___motion: armature). I tried out several different sensors and actuators, as well as material and property sensors…nothing changed.

Is there something I’m missing on using the parented object? Cuz it’s no use if I doesn’t allow for logic bricks.

Is your object an actor? It won’t respond to collisions if it is not.

otherwise this method would work to make armature rag dolls

Well I said it worked if used for animation not for physical behavior, besides parenting a bone to a dynamic object doesn’t work, it was said in… I don’t remember in with thread but it was said when version 2.46 got out…

Oh yeah, thanks! I’ll try that after work today when I get a chance.

I’d go talk to Erwin if I were you. He’s been messing with integrating the latest version of Bullet into Blender. So, there might be something in the SVN for you.

It works correctly with the ray sensor, but not the collision or touch sensors. Ray sensors should be okay, but I’d prefer collision sensors.

Is there a way to get collision sensors to work?

Attached blend is using ray sensors…
W moves the armature closer to the test object.
SPACE makes the armature animate.
When the armature “box” touches the “test pillar” it will increase the prop1 property by 10.

Attachments

CollisionTesting.blend (142 KB)