Help and examples in this topic, there is free and extended help on BGE.
---------------------------------------------------------------------------------------------------------
Hi there.
Here is an example of an animated cylinder with bones - test_anim.blend (489 KB)
But when you play the animation ( squatting, space bar), the physical bounds of the cylinder do not change - both in interaction with bullets and the beam.
How then to solve the problem of exact hit of a bullet in the player - an arm, a body or a head after squatting or change animation?
I mean - is it possible for physics to interact with animated bones by the player (the model itself), without additional objects?
You can also move the “player” with the keys - DA.
OK man. Job well done. Several characters per line - own.reinstancePhysicsMesh() - and a miracle happened, the green mesh now crouches.
And of course, it’s best to use separate objects to detect bullets - it’s easier to create a system of injuries and disconnections when a bullet hits - arms, legs …
Thank you for your help.
docs.blender.org - this is the Blender reference - that is, everything that is described, everything works. There really are nuances with a mesh, it is highlighted in red.
there it is indicated in the description that there is a load on the system, when scanning the mesh - so probably it will be more correct - test_anim.blend (499 KB) - Now the mesh update turns on if the [“prop”] > 1.
Quick warning: Reinstance physics mesh is very processor heavy. On a modern i7 you can only reinstance about 2000-4000 polies per frame before you start getting lag.
For physics hit-detection it is better to use smaller non-deforming shapes parented directly to the bones. Of course, this will need lots of collision logic bricks (or in python: linking all the collisionCallbacks)
test_animDiceTable.blend (502.4 KB)
I went ahead and add a randomize function so as to mimic game dice tables. If the player is wearing armour there is 1 in 3 chance it will penetrate the Armour. I also change the collision bound.
OK , but I still do not find myself applying this … just probably I have now other interests so far … go smoke, or what ? in “Holland” … Of course it’s a joke.