I’ve been having a hell of a time trying to get attachment to work the way I want, and everything I try seems to have issues. I’ll list them all here so others don’t have to go through the same Hell I did.
It may well be I’m doing something wrong, so please chime in if you have any tips / disagreements. Seems excessively hard for something that should be a core function?
1. Straight parenting (ie, AttachParent = MyMesh)
- Produces a nice rigid attachment
- Doesn’t work if you simulate physics, which means you can’t get Hit events
- If the object collides with a physics object, the other object goes flying.
- Seems reliable
- Replicates well
2. Physics Constraint
- Allows physics to work, so you can get Hit events
- Often not rigid, so you get wobbles. Can be sensitive to mass scaling
- Seems to provide good physics interaction (ie, other objects don’t go flying)
- I’ve had issues with replication becoming excessively jittery
3. Welding
-
Produces a rigid attachment
-
Allows physics to work, although there are issues (see below)
-
Mass and center of mass move, seemingly independent of the mass of the attached object. This can be corrected via direct PhysX calls only.
-
Different collision settings on different components like Overlap or Block don’t seem to work, at least not for me.
-
It produced a bug where deleting Actor B caused a welded component on Actor A to detach and have it’s physics reset. The Actors are not related in any way, with no obvious references to each other.
-
Replicates well
-
Not sure how it works with skeletal meshes and other more dynamic content
Have I missed anything? Does anyone have any tips or other options I’ve missed?