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:
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.
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.
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?
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’
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.
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?
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.
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?