How to sync the cloth simulation data with skinned human vertex position

Hi, i want to use filament which is a 3d engine used in mobile end to recover the cloth simulation result. However after i finally get the simulation vertices position with calling GetCurrentSimulationData_AnyThread() api, i found that there are some sync issues between the human skinned position and cloth simulation data.

Here is the context:
I setup a timer to get the cloth simulation data periodically and call GetCurrentSimulationData_AnyThread() api during the timer callback. However the simulation data is often empty so i use a while-true-loop to call the api i mentioned above to fetch cloth simulation data. After i fetch the cloth data, i call the ComputeSkinnedPositions api to fetch the skeletal human’s skinned position. But the cloth data seems a little behind human data in the time axis. If i make the human jog animation fixed at some special time, the cloth and human data would be consistent.

Screenshot:
Here is the unfitted rendering effect as below:
image

Maybe try

USkeletalMeshComponent::GetCurrentClothingData_GameThread

There is a part in the doc that states

Get the current simulation data map for the clothing on this component. For use on the game thread and only valid if bWaitForParallelClothTask is true.

perhaps the bWaitForParallelClothTask is crucial? Maybe you are getting the clothsim before the task is complete, so from 1 frame back?

Thanks. I will have a try