UE-56479: Jittering effect with Physics Constraint Actor using Linear Limits

Link: UE-56479

I have been asking for help in answer hub for several months and never get any reply/answers. Wish to have some luck here. I am forced to stick with UE4.18.3 because the problem exists in 4.19-4.21 and it is marked “Won’t Fix”. Does that mean no one ever uses linear limits with physics constraint? How do I make a dangling sphere like the sample project in UE4.21? Thank you.

Correct me if I’m wrong but isn’t the dangling sphere only using angular limits?

I was able to get appropriate linear limits working on a skeletal mesh’s physics asset in 4.21 but it might not behave the same if I apply the same constraint to a blueprint. I won’t have time to test this week.

Thank you for your reply, NotSoAccurateNo1.

Angular limits are not relevant to my case because I am not limiting the angle of swinging. I am using linear limit because I wish to simulate the length of the cable by setting the value of linear limit Z. However, that will make the sphere behave strangely.

I modified the sample project to better illustrate the problem. There are now 3 sets of dangling spheres. From left to right:
1: The original swinging sphere
2&3: The spheres are located right below the respective physics constraints so that they will become stable when linear limit (Z) is reached

When play/simulate, a fourth sphere, as it falls, will touch sphere 2 and I expect sphere 2 to just swing left and right slightly. However, it will shake violently like sphere 1.

Link to modified project: 260389-myproject.zip (952 KB)

As some new marketplace items no longer support 4.18, I really wish to proceed to use the latest version. Please, if anyone has any idea about the problem, do say something. Thank you.

Try putting the Physics Constraint in the world as a separate actor (superimposed with the cable actor) rather than attached/parented to the cable actor. It seems to fix the issue in your case (even if it’s more like a workaround; it’s definitely bad when new “Won’t Fix” jitter appears where there wasn’t any).

Thanks a lot for your reply, GeyserToo. I did a quick test as you suggested but the problem still seems to exist (266882-. If you get it to work differently, do you mind uploading a sample project? Thank you.

What is the expected behavior here? The previous example has just one sphere falling straight down, but here the middle sphere nudges the other two sideways. If you want to allow them to swing freely then why is their constraint “locked” along X and Y? or is your point that you expect those two spheres to remain on their Z-aligned “rails”, without being affected by the nudge?

EDIT: OK, I’m confused. So many different tests for such a simple question… All those are supposed to be pendulums, right? And pendulums on rails, sort of? Your intention is that the cable/rail should be allowed to rotate in the XZ plane (around the top constraint), and the sphere should be alllowed to slide along the cable/rail, with a maximum cable elongation of 200 world units? In that case I am not sure the locked X and locked Y are appropriate here. If anything, you should be using a chain of two constraints: one for the rotation degree-of-freedom at the top of the rail, and then a linear degree-of-freedom for sliding along the rail. And then I suppose you should carefully adjust the physics properties of the rail and the sphere (collision type, mass, etc). If this is an actual cable though, then why not use it as such, with linear limits of 200 in the XZ plane, without “locking” along X? (if you unlock X, then you no longer need rotation freedom at all).

GeyserToo, I apologize for the confusion. Sample 266882 was just to show that the sphere still jitters even if I used a separate physics constraint actor. Besides, my game is a side-scroller and I had to put some physics limits; I should have removed them in the first place. Anyway, I made another sample (267796- in the past few days and this should be clearer of what I am trying to do.

I wish to simulate a crane lifting up objects. The scene has a hook mesh and the end has a physics constraint (and cable) component which constrains a cube below. Above the hook is a physics constraint actor (with cable) which constrains the hook itself. A level blueprint sets the Z-linear limit between 0 and 300 units according to time; this is how I simulate a crane lengthening or shortening the cable. The value of the limit is displayed on screen.

In 4.18, the scene works perfectly. Spheres are spawned upon mouse clicks and the cube behaves accordingly when hit by the spheres.

In 4.21, the hook goes haywire when linear limit is > 200 and I have no idea of what I can do.