Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UPrimitiveComponent
Description
Welds this component to another scene component, optionally at a named socket. Component is automatically attached if not already Welding allows the child physics object to become physically connected to its parent. This is useful for creating compound rigid bodies with correct mass distribution. By default if the root is kinematic then the welded bodies are set to kinematic rather than actually welded. This is beneficial if the actor is not moved very often or only contains a few welded shapes. However it can be expensive to move a kinematic actor that contains a large number of (unwelded) kinematic children, in which case you can setting bWeldToKinematicParent to true to generate a welded kinematic actor. There is no real benefit to welding if the actor does not move and, since the initial weld cost is fairly high, you generally would not enable welding on all kinematics in the world if you have a lot of them.
| Name | WeldTo |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/PrimitiveComponent.h |
| Include Path | #include "Components/PrimitiveComponent.h" |
| Source | /Engine/Source/Runtime/Engine/Private/PrimitiveComponentPhysics.cpp |
virtual void WeldTo
(
class USceneComponent * InParent,
FName InSocketName,
bool bWeldToKinematicParent
)
Parameters
| Name | Remarks |
|---|---|
| InParent | the component to be physically attached to |
| InSocketName | optional socket to attach component to |
| bWeldToKinematicParent | if true, children will be welded onto the parent even if the parent is kinematic (default false) |