How to Troubleshoot "Record Simulation"

Branching off from for discoverability.

In the above case, we’ve got many things happening at the same time, and the best place to start is to try and break a big problem into many small problems, starting with:

  1. Simulation Problems
  2. Recording Problems

Simulation Problems

If we remove the recording, we can spot at least 1 issue. The arm is making a drastic move on the first few frames.

Drastic moves on the start frame is Ragdoll trying to correct for something. Typically, there are two causes.

  1. Limbs intersecting with another limb
  2. Limbs starting outside of their limit

In this case, I suspect limits. Although I cannot spot anything obviously wrong. Both the arm and clavicle appear to start inside of their limits.

A robust way to make sure is to temporarily disable all limits.

That appears to have solved it. But sometimes it can be difficult to see due to the character also falling under gravity, so let’s also temporarily disable gravity. We should expect no sudden moves when starting playback.

Bingo. Now let’s dive into the original limits and try to spot which one caused the issues.

1. Identify which limit (or limits) cause the issue

That’s the one, but why?

Ok, we can see that the YZ axes lie outside of its limit, meaning Ragdoll will try and rotate the arm such that it is back within the limit. In this case, that’s nearly 180 degrees, which would explain the sudden pop at the start. Because these axes are also locked, rather than just limited, the motion is instantaneous as opposed to the soft cone that otherwise depend on Limit Stiffness and Damping.

2. Reset the Limit

This button is the equivalent of Ragdoll → Utilities → Reset Constraint Frames and restores the limit to what it had at the time of assigning the Markers in the first place and is a good place to return to when having these kind of issues.

Alternatively, you can try and asymmetrically edit the limit until the red axis line lies within the red limit cone.

3. Profit

To confirm all is well, playback the simulation once more.

Recording Problems

Next let’s look into why, despite a successful simulation, this cannot currently be recorded.

Other than the result being completely bonkers, what specifically can we observe?

  1. The hip is not moving
  2. The knees do an awkward bend

Let’s have a look at what our Retargeting UI has to say.

Great, we’ve got a plethora of warnings. Primarily green ones, which indicate that the channels Ragdoll would record onto are already driven by something, other than animation. In this case, there is a constraint.

Ragdoll is just an animator. And an animator and needs to do what animators do: set keyframes. It needs to set keyframes on the controls that move parts of your character. In this case, Ragdoll is attempting to set keyframes onto controls (joints, in this case) that cannot/should not be keyframed.

For example, when moving the root, it doesn’t actually move the character.

Let’s follow the connections into this node to try and find which one actually does translate the character.

Using the node editor, we land upon a separate hierarchy. It’s not clear to me why this hierarchy exists, but this is the one Ragdoll should record onto. In this case, it could have been assigned onto in the first place meaning it would follow the right thing, and record onto the right thing. It would have avoided the need to even look at the retargeting UI.

With this information, one thing needs to happen and a second thing is optional.

  1. Controls that cannot be recorded onto must be retargeted to ones that can
  2. The original controls do not need to be assigned to, and can be reassigned

The ideal route would have been to assign to this separate hierarchy from the beginning, that would have automatically handled both following of the input animation and recording back onto it. But if you find yourself in a situation where you cannot turn back time, you can retarget.

Now that our Retargeting UI is warning-free, it’s safe to record. :crossed_fingers:

And there you have it! :partying_face: