Blueprint - "set constrained components" failing

Hello,

I have a simple blueprint example where in my construction script I create 2 box components and a physics constraint to connect them together.

i leave simulate physics turned off in the construction, but enable it later in the event graph after event begin play.

the boxes are named box1 and box2, and if i set these names directly on the “add physics constraint component” node everything works fine.
However if I try using a set constrained components node, no links are created between the cubes on play. It does seem to draw them though in the editor before i press play.

this was working in 4.3, but it seems to always fail in the newer versions of the editor.
here is an old test video showing a set up where i auto generate constraints:

here is the test blueprint:

Hi sandmeister,

You said this was working in 4.3, what version of the editor are you currently using?

Hi TJ,

4.7, but it was failing in 4.6 as well. I thought I must have been doing something wrong after not touching the blueprint for a couple of months, but i saw another post yesterday where someone had the same problem.

I was able to reproduce this in the 4.7.0 Preview and our latest internal build. I entered it as JIRA UE-7878 in our tracking software and our developers will be investigating the issue further.

The workaround would be to set the components manually for now.

Cheers,

TJ

Thanks TJ, great to have this confirmed. Are these Jira tickets accessible to subscribers to view and keep track of? Cheers.

At the moment no, but this is something that is being considered. Generally if there is a significant change in the status or if it becomes fixed, I will update here. If a unreasonable amount of time passes, post here and I will see about getting an update.

Was this ever resolved?

Its being tracked as a known issue here:

Unreal Engine 4.7 Released! - Announcements - Unreal Engine Forums!

Hi,
I reproduced this issue and tracked it down. Fixed the code internally to handle the case where attachments were being set via a construction script.

btw, I’m not sure of the code release timeline, so i’m not sure when this new and improved handling of object attachment will be “hitting store shelves”. Yo TJ, release date?

Hey guys,

Any word on whether this got released? I’m only just revisiting it now and from what I can tell its still not working in 4.10? Cheers.

Hi sandmeister,

This was fixed in 4.10. I just tested it in the official 4.10.2 release and it is working for me. These are the steps I followed. Give them a try and let me know if it works for you or not.

  • Open a new BP project (I used the 1st Person template)

  • Create an actor class blueprint & open it

  • In the Components tab, add a Scene component to the Root

  • Add a Box component, enable ‘Simulate Physics’ & disable ‘Hidden in Game’

  • Add another Box component, only disable ‘Hidden in Game’

  • Set the X location to 100

  • Add a Physics Constraint component

  • Set the X location to 50 (See screenshot #1)

  • In the Construction Script, add a Set Constrained Components node and set it up like screenshot #2

74278-setconstrainedcomponents02.jpg

  • Compile & save

  • Place the blueprint into the level

  • Play the level to see if Box1 is constrained or falls

Thanks for your reply TJ, and the steps you outlined do work in 4.10.

However, this other blueprint I’ve put in the screenshot below does not work, the constraint seems to just break on play, and I really can’t see why it would. I’m parenting the constraint node to one of the objects im constraining, and setting world positions etc, but otherwise its pretty much the same as your example right? The only other main difference is im creating 2 box collisions in the construction script, they are not pre existing components in the blueprint.

Any ideas? Thanks again.

Playing with this further, I can confirm it only works if the boxes/meshes are pre existing, it fails if you create them in the construction script itself.

Following up again, if I move the constraint creation to the event graph, and then do the “set simulate physics” ON also in the event graph, everything works.

What would be great to know is SHOULD this work in the construction script?

cheers.

Hi,
it seems that it is the static mesh components that have to be created in the Event Graph.
If i create the mesh in the construction script and construct the constraint in the event graph, it doesn’t work neither.

Daes

Hi Sandmeister,

Sorry it’s been a few days.

I entered it as JIRA UE-25958 and our developers will be looking into it further.

As a workaround, I noticed that your setup doesn’t work in PIE but it does work in Standalone mode. Which means it should work in a packaged game.

Cheers,

TJ

Hi, using 4.11, I was able to use the construction script to create the static mesh components and “set physics simulate” ON, but needed to create the constraints in the event graph (on begin play)

I am trying for so long to constraint a box to an Blueprint object with no success.
It works when I constraint to objects with PhysicsConstraintActor but if I want to connect an object with a blue print the blue box never appears.

In the pictures attached the sphere is a normal object and it connects with the box and in the next image the cone is a blueprint actor and it just not constraint

Can you please advise on what to do in this case?
Is there any other solution I can try?

Thanks,
Adrian

I got it working :slight_smile: It happens all the time just like someone telepathically answers me after I post a question.

I made it work inside the blueprint.

Best,
Adrian