Simulated Bones under Simulated Parent

Through the development of our January Jam submission Sketboard we encountered an issue with skeletal mesh selective simulation. We seem to have no way of having our skeletal mesh have physics-simulated bones while it’s under our physics simulated root component.

Here’s how our pawn is currently set up:

[root] Capsule Component
-Simulating physics
-Driven by blueprints for our character’s movement
Character Mesh
[INDENT]-Skeletal Mesh
-Kinematic
-Detaches from Capsule when the player falls
-Animated
Spring Arm and Camera
Skateboard
-Static Mesh
-Kinematic
[/INDENT]

Here is a screenshot of the setup.

What we tried doing is, in the physics asset, setting everything but the arms to kinematic. If the Capsule simulation is turned on, the skeletal mesh detaches and its transform is in worldspace. If the Capsule is changed to kinematic, the simulation on the arms works, but our character cannot move since our movement is physics based. We also tried using a Scene component root and unparenting the skeleton from our capsule, then using a physics constraint. This doesn’t work, though, since the skeleton has kinematic bones necessary for rigidity.

If there is a way of achieving this, please let me know, however I expect that this is a limitation of the component system in UE. If so, please consider this a feature request!

I’m afraid this is a limitation of the engine. We only run the physics engine ‘once a frame’, so you can’t have a physics object, that then goes through animation, and then back to physics again, and have everything sync up :frowning:

In UT3 I solved this by jointing the feet of my ragdoll to the hoverboard, and not using any kinematic bodies. This did use ‘dominance groups’ though to prevent the ragdoll affecting the board, and that is not currently exposed in UE4 (though I think you could quite easily do this yourself).

Another more invasive option is to have an additional physics scene, so you run the skateboard, update the skeletal mesh position and animation, then run the ragdoll sim, then update the skeleton render transforms.

You could also try using spring controllers on the skeleton rather than physics simulation.

Sorry there is not a simple solution… Complicated hierarchies involving physics and animation are tricky…

Thanks for the response James! Please excuse my noobiness, I didn’t think I’d be talking to the lead framework programmer :eek:

I’ve been messing with it over the weekend and was trying an approach with the skeletal mesh as the root component, doing away with the capsule. The UT3 hoverboard solution sounds amazing, it’s basically exactly what we’re trying to achieve. I’m fascinated by the fact that it was with no kinematic bodies.

I attempted to give the ragdoll some rigidity using angular orientation drive.
The results are promising:
http://servitude.accelgames.com/files/rigid-ragdoll-animated.webm

I think all we need to do now is find a way of attaching the foot bones to the skateboard and using dominance groups, like you said. Every attempt to use a physics constraint just results in everything flying all over the place. It would be very cool to have an option in the physics constraint component to choose a dominant body.

Any advice on how to achieve this would be truly appreciated!

Edit:
Through some component trickery, I managed to get both feet attached:
http://servitude.accelgames.com/files/rigid-ragdoll-rubber.webm

It’s 99% there, but he’s rubbery as hell. I wanted to solve this using physics blend weight, but that has no effect. The angular orientation drive is set to something like 9999999937.2, lol.

Could you provide any more information on this? Where is the ‘run through the physics’ being done? Where does it make the decision to only affect one or the other? And can I rewrite things to make the skeletal mesh go through ‘the physics run’ straight after the capsule has?

If not, what about having two separate actors, one for a simulated capsule and then another for a simulated skeletal mesh that is constrained to the capsule one or just follows it around?

So far I’ve set up a quick blueprint based on this question, but the bones won’t simulate unless the capsule is either not simulating or has come to a halt whilst simulating.