Jiggle bones using skeletal mesh physics

I’m having issues creating jiggle bones in my project. I’m trying to use the physics system (PhAT) to apply physics to certain parts of a skeletal mesh, to simulate trailing clothing and hair. This seems to work for small chains of one or two, but one of my objects is a chain of 4, and this is where the problem comes in. For some reason, this chain never settles down, and just spins violently around its anchor point. I have made sure that none of the colliders are interpenetrating, but the problem persists. I can’t seem to work out how to get this to look smooth and effective, and to get rid of this effect.

EDIT: Essentially, after many attempts at using this system, and getting better, but still not adequate, results, I am looking for a system that simply allows rotation of bones based on motion. Even just custom rotation of bones via blueprints would be nice. All I’m trying to do is tweak the rotation of some bones as the character moves, and, while it works some of the time, it still fails when the character moves too fast, stretching out horrifically, despite being locked in position. There must be a way to do this that doesn’t require enormous amounts of work just to make it not glitch out immediately.

This is the kind of effect I’m looking for: Jigglebone Testing - YouTube
Note that no stretching or position calculation is required, which is automatically done with the PhAT system. This unnecessary calculation is what causes the problem, as it judges incorrectly, and positions the bones at the wrong place, when in fact all they need to do is remain in place relative to the character.

Part of the problem (perhaps the whole problem) is that the physics parts of the mesh don’t seem to collide with the non-physics elements - it seems to sink inside them instead, and then receive a huge impulse from the interpenetration.

Hmmm… it seem that this behaviour is still present, even if all axis constraints are set to “locked”

Using spring joints in the animation blueprint is also a fruitless effort, as it either produces far too much jitter (from limiting the displacement), or allows far too much stretching. It would be appreciated if I could get some help on this soon, as it’s a rather urgent issue that needs solving.

It also seems that the physics do not work well even for small chains, as they produce the same issue.

Aha! Turn out I didn’t have my collision set to “Physics Actor”. Doing that has made the jiggling much better. There is still an issue, though. Despite having every bone set to displacement “locked”, when moving, the bones still displace heavily, which is very undesirable. I only want these bones to rotate, but to otherwise keep their existing positions with respect to their parent bones. Is this possible?

Also, this stretching means that these jiggle bones are often being caught on the world environment, causing them to prevent the player from moving in certain situations. Oddly enough, smooth jiggle bones are actually extremely important for this game, as they provide a better sense of the player’s movement, and at the moment, this is looking like an impossibility.

With some more work, I’ve determined that the issue is caused by large impulses as a result of fast movement. Is there a way to cap the maximum impulse given to a bone in a physics asset?

https://answers.unrealengine.com/questions/12622/unreal-engine-4-softbody-physics.html Thanks me later :stuck_out_tongue:

See my comment: “Using spring joints in the animation blueprint is also a fruitless effort, as it either produces far too much jitter (from limiting the displacement), or allows far too much stretching”

This is not a solution for me.

In any case, spring joints only support displacement, where I’m looking for rotation.

Did you tryed maya ART plugin? it has jiggle bone rigging support

I do, but it does not seem to work correctly. It seems to bake jiggling to the animation, rather than allowing fully dynamic bones. This is perhaps due to issues I have getting the ART plugin to recognise my skeleton, which I have asked in a different question.

Okay, more testing! I can get something working very nicely in PhAT, with poking producing the desired behaviour, but when using it in game, it tends to go completely haywire, with lots of jitter, and even some bones freezing in place (in world space) while the player moves around them, causing huge stretching.

What if you just add the bones, without any jiggle, physics, or animation, and then set the bone orientations in a blueprint every frame?
I’ve done this for things like cannons auto-aiming at targets.

I’d like to do this, but how do I access the bone orientation from a blueprint? I looked, but couldn’t find the correct function.

So, I have ART importing the character correctly now, and my objects are set up as a dynamic chain and a jiggle bone. If I export the motion using ART, will these be correctly interpreted when I import them to Unreal, or will they be baked to the animation?

Ah, looks like they’re baked only, which is fine for some of the bones, not so good for others.

Do you know if you have substepping turned on? In UE3, this was always on by default and makes for a much smoother simulation. In UE4, it’s now an option (sadly off by default). It does come with a performance cost, but it makes the physics look SOOOO much better.

1 Like

sorry, realized I didn’t mention where to find this :slight_smile:
Edit->Project Settings->Physics

I’ll give this a try and report back! The performance cost is something that can be dealt with. We are only simulating about 8 bones total, so a more expensive simulation shouldn’t be too much of a problem.

I’m happy to report that the simulation is VASTLY improved! It now doesn’t cause position glitches unless there’s a major teleport (which hopefully there won’t be in the final game), and even then it recovers quickly. Thank you a lot for this!