How to move and rotate physics constraints with blueprint

As much as I would like to put this under the blueprint section I think I am suffering from a lack of knowledge about the engine this is why I chose that section to post in.

Here is my question, how can we move a series of objects linked by a series of physics constraint without breaking anything.

****** Here is my first issue that I had and tried to overcome alone******

  • I have 2 of the same series of objects attached with physics constraint. I wish to modify their position and angle independently then have one copy the other position and angle (for each objects in them)

(my attempts at solving this issue)

  • Several hours of research on google to find little to none documentation about this feature.
  • For my first issue I tried to forloop through each object of the chain1 to copy positions of chain2 then do the same for rotation but it did not work.
  • I then tried a forloop doing position and rotation for each object instead of covering the array twice but the same thing happened (the character kinda explodes in the sky).
  • I tough about spawning an object instead to replicate the chain2 while deleting the original chain1 but that is clearly not a good idea as I have variables to keep track of in the chain1 that are different from the chain2 as well as different components

This is the second issue

  • The second issue I have is that if I use before making the move and rotation then reattach the constraint to the same objects I get a bug as there will be an offset in the limit angles if there is any offset with the original angle on each joints when it spawned, which makes sense as the constraint once broken and reattached probably reset the angle value to 0.

In other words I think there are 3 options available:

  • I either need to be able to prevent the series of constraint from exploding after rotating and moving them (does not seem possible in unreal, if it is please let me know)
  • Or I need to be detaching the constraint, moving and rotating everything, reattaching the constraint and apply an offset previously calculated to fix the bug(how would I calculate this offset please help?)
  • Or I access the angle variable that was used by the physics constraint script before detaching it and once reattached I would overwrite the default 0degrees for that values BUT clearly that wont happen. Any suggestions?

I would hate to give up on this as the only other option remaining for me is to start from scratch with a model that has bones and figure out a way to do the exact same as physics constraints (without the issues of course).
I already had to give up on that project when working in unity for weeks before switching to unreal.

Bump, this is the core of my game, I gave up on too many projects that had unanswered questions in the past and this question will clearly help other developers in the future as well.

I need any kind of help/suggestions here, thanks in advance.

Hi there,

Hold down the left alt key while you rotate the constraint in order to offset its orientation (The rotation position is not showing correctly but it will work). After messing around with it for a minute, that’s the only way to get things like knee joints to work properly so they don’t bend forward also.

1 Like