Download

Physical Contraints and Vehicle Attachments

Hello everyone, I just started using UE4 and have had success with creating a vehicle and getting it into the engine plus driving around. I have created a trailer model in maya and had a bone specially for connections called Joint_Ball. I have tried and tried to use Physical Constraints time and time again. If someone could please point me in the right direction that would be great.

457e380e3fcc05337eec89c7fa85f74c.png
f837023d87a0341805a0b47594f5f031b8729094.png
89385b396381f85ba2c87e15e225090f3c82850e.png

Thanks Fred.

I need to look at my code but from what I remember setup was like this:
Each of your actors - tractor and trailer, need to have a physics simulated component, attached to their root with physics constrain locked on all axis. This will be your couplers.
From tractor or trailer, spawn a physics constraint ACTOR not a component. Spawn location should be somewhere in between two objects that you want to constrain.
Both tractor and trailer implement interface which returns reference to their coupler components. This interface allows to plug both couplers (one from tractor and one from trailer) into Set Constraint Components of Physics Constraint Actor.

While I was writing this I’ve realized one unfortunate detail, this might not work with vehicles based on vehicle movement class. At least your trailer shouldn’t be based on vehicle class as they are purely kinematic and can’t be moved by physics interaction. Tractor should work fine as long as coupler is attached as child to kinematic parent.

Thank you, im going to try this right now

I’ve checked my code and it’s done as I’ve described. The only addition is that I attach Physics Constraint Actor to back coupler, it’s not necessary but otherwise it’s root will just stay where it was spawned.