Download

Unable to constrain two entities together.

Hey all,

I am trying to make a sandbox like game sort of similar to Garry's Mod and am having a rough time. I made the basic prop entity and now I am trying to "weld" them together. When I left click, I am doing a raycast and getting the entity and saving it to an array. After I have two entities in the array, I am trying to use the Attach Actor to Actor node but when I run into one of the props, the other doesn't move. Any ideas?

I also tried doing several things like making a physics constraint component but I still can’t get it to work.

I’m not sure I understand you correctly, but if I did - Download “Content Examples” from Marketplace and open “Physics” level, then find 1.5 example!

I took a look at the samples and it looks like they were all placed at level creation while I need mine to be made at runtime.

Check out:*Blueprints_Advanced *level in the Content examples. BP_Spotlight specifically; they are using the construction script tab to build and attach object parts.

Are you trying to build an object group at runtime or attach 2 separate objects at runtime ex: attach a silencer to the tip of a gun?

Well, then make it at runtime

Okay, I got it to work. I had to use more nodes than I wanted to convert the actor to a primitive component but, after that, I was able to push one and have the other move.

One more quick question; How do I make it so that the objects can’t rotate around the other? For example, when I push one of the objects toward the other, the other one moves. When I push it tangent to the other object, it doesn’t affect the other. Any idea? I see some nodes that affect the angular drive but I don’t think that is what I am looking for.

Heya NeonNewt,
If you’re creating a Physics Constraint Component in the Blueprint (not spawning a Physics Constraint Actor), you can just select the “Add Physics Constraint Component” node and in the details panel you’ll be able to set its defaults.

I tried replacing the physics constraint actor with the constraint component but I can’t figure out how to change its properties using nodes. I can’t use the details panel because I want players to be able to customize it using a menu.