For an arch viz project, I created a script that generates folding doors to a given size and door count, and animates them procedurally. The folding door is built as a chain of pairs - each pair is its own actor. Each subsequent pair is attached to its neighbour, so it moves along with it. The video below will show the concept, and the problem.
For some reason, when rotating actors in a hierarchy, the resulting movement is incredibly jittery. The problem is less pronounced when I fold one pair at a time, but it’s still there. The hierarchy of a pair is built as such:
The hinges are located where you would expect them to be - the master and slave hinge are in the same location, between the two doors. Each pair is attached by its “hinge to previous” to the preceding pair’s “hinge to next”. The following bit of code from the folding pair actor’s Tick() is all that is done to animate the doors:
FQuat angle = FQuat::Slerp(FQuat::Identity, FRotator(0, 90, 0).Quaternion(), _erpPos); _hingeFromPrevious->SetRelativeRotation(angle); _hingeToNext->SetRelativeRotation(angle); // Mirror rotation on slave hinge. _slaveHinge->SetRelativeRotation(FRotator(0, -FMath::Lerp(0,90,_erpPos) * 2, 0));
So, who knows what’s up?