Attached actors or components physics collision
I'm struggling a lot to make a simple feature of my game work.
In my game I have a vehicle on which you can attach extra parts (tools, weapons, etc ...). An extra part is an independant Actor that by default lays on the ground and that can be picked up and attached to the vehicle.
Here a simple example, you can think of the extra part as some sort of vehicle tunning to bump into zombies during an apocalypse. (the image is not from my game, it is just for the example)
What I need is that, when I'm driving my car, the bumper has to collide with other actors. However after many days lost on this, I cannot make it work. The bumper always overlaps any other actors when my car run into them. For example, I smash the car into a wall, the bumper will overlap and only the car will collide. However the bumper collides properly with other actor when not attached to the car.
I'm attaching the bumper via C++ (but it's the same with the AttachToActor Blueprint node)
After reviewing all this answers, I could not make it works either : https://answers.unrealengine.com/questions/37576/activating-physics-detaches-component.html https://answers.unrealengine.com/questions/13767/multiple-constraints.html https://answers.unrealengine.com/questions/326577/collision-of-attached-actor-does-not-work-correctl.html https://answers.unrealengine.com/questions/762569/attached-component-to-actor-has-no-collision.html?sort=oldest https://answers.unrealengine.com/questions/663248/attach-actors-with-physical-collision.html
Is it even possible and how do I enable collision on the bumper (child actor) when moving the car (parent actor) ?
Found the solution !
I needed to create a UPhysicsConstraintComponent attached to the car skeleton, then apply the constraint between the bumper skeleton and the car skeleton.
Now I got my collisions perfectly working ! When I drive the car into a wall, the bumber collide and the whole car stops without the bumber passing through the wall. Hope it helps someone else.
Below the variables are :
The code :
Follow this question
Once you sign in you will be able to subscribe for any updates here