Creating broken gore bones doesn’t require model editing and steps from 1 to 4.
This is a guide for users that already know how to weight their models, import from and export to UE4. Expanded version of the tutorial (or short video) will be created to cover basic topics like ‘how to export’ or ‘how to set the weights’, if requested.
Prepare your skeletal meshes for dismemberment.
To do this, the part you want to break needs to have its own unique polygons/vertices where you’d want to break it. UE4 will not break your meshes, only the bones, your meshes must already come “pre-broken”. To be sure it’s correct, in 3dsMax go to sub-object -> element, select the one you’d want to break and move it, if you see stretching then it won’t break off. It needs to look breakable like this:
Using Gore Kit, it’s easier and faster to remove vertices that you don’t need, e.g. torso for human-like creature. That way we have 5 body parts and can export it as a whole model to UE4, Gore Kit will do the rest of the work.
Modify the bone weights so that the breaking bone (e.g. head bone) fully affects the breakable element of the mesh and nothing more (ie. the neck bone needs to have zero influence on the head section, and the head bone to have zero influence on the neck).
After export to UE4 make sure your “body parts character” uses the same Physics Asset of your original character or newly generated. What you’ll really be breaking isn’t really the bones of the character, but the phys bodies attached to those bones instead. This means that for a bone to be breakable, there needs to be a phys body specifically attached to that bone in your Phys Asset (bodies attached only to child bones won’t work).
In the DataTable create a new row and choose Blueprint that uses this character model. In the bottom list of body parts, create 5 elements and set bones names for them (Head, UpperArm_L, UpperArm_R, Thigh_L, Thigh_R). For each of these 5 elements set the same mesh (our exported cutted body parts model) or different, if body parts were exported separetely.
On event when character takes damage, call the function “TryToDismember” of the GoreComponent instance.
When projectile hits the character, from the “Event Hit” we call the function “Try To Dismember” with parameters from the event: actor (it must be Character), bone name and hit location.
Since, you probably don’t have “Event Hit” with using melee weapon, when u swing through character, you should artifically call the standard node “Make Hit Result” and fill its parameters (actor, bone, hit location). That’s all that is required to change projectile to melee. Just have to adjust your melee weapon collision to get these 3 basic parameters.
how do you handle partial breaking in hierarchical parts? i.e. in a setup where you can break an arm at the elbow and the wrist, how does the elbow look when you break the wrist?
yeah I understand that you switch meshes
I still don’t get how you handle cut parts on a mesh that has non-rigid weighted verts, and a seamless material. for example that last human character, how you’d cut the naked arm at the elbow and the wrist.
as an example: if you cut the arm at the wrist and swap the hand mesh (to chop it off) and also swap the forearm mesh (so the wrist vertices don’t stretch), the vertices on the elbow area would appear to be cut.
for example in this picture by -SP- you can see what would happen if you swap a mesh but keep it attached - so that’s how elbows would look in the scenario that I’m describing,
The UDK version was able to swap the weighting values of just the cut area (called partial swapping). and that’s why I’m asking how your system handles such cases
It’s just spawned when needed, with calculated location and rotation, on the same frame when original body part is being hidden.
For example, when spawning a hand, the whole mesh is spawned too (head, legs and other hand, no torso), but other body parts are hidden with disabled collisions. And physics is enabled only for the hand.
I’m still pretty lost… i have a mesh, and i have a box collision as a child. When the box collision hits the skeletal mesh, i want it to call “Try to Dismember” but when i try to do it like that (OnComponentHit or OnComponentBeginOverlap) nothing gets called… Can you tell me exactly what i need to do? Cause i really wanna start using this, but these events are not working. It works for Linetraces, tho.
Your OnComponentHit/Overlap probably doesn’t return bone name (or also location) for Characters. It’s not Gore Kit, you should remove for now node “Try to Dismember” for the test and use “Print String” for example, to see if you get all 3 required parameters (actor, bone and hit location). That problem with solution might be related to yours. If you will still have problem with this, I’ll play with it a bit later.
Hello, Gennady, im writing this message to ask you a question about the Generated Gore Dismemberment pack I recently pruchased. When a character is dismembered his neck bone stays floating in the capsule and is not destroyed. Do you know anyway of fixing this.