Snap Collision Box to Root Component Difficulty

I’m trying to make an actor that, when the BeginPlay function of the character is called, is spawned in the world. The Spawning of the actor works fine. However, this actor contains three components of the root, static mesh, and a box. The box is used as collision. I was able to generate overlap events fine. The box itself however, does not snap to the root component (or the mesh) correctly. I used the FAttachmentTransformRules::SnapToTargetNotIncludingScale to snap it but it seems the location of the box is off relative to the root and mesh. The picture below shows where the collision box seems to be in blue and where it should be in red. Another weird thing I found is that when I drag it into the level manually from the content browser the box, mesh, and root are all snapped, but the actor that is spawned in code is off. I assume it may be a simple thing but I can’t really put my finger on it.


SpawnActor() is called here in the BeginPlay function of the character


Fixed it using a little workaround. I just attatched the mesh and collision box to the root and then set the relative location of the mesh as the same thing as the root but I subtracted 100 from the Z coordinate. GetComponentLocation().X gave me the x coordinate and .Y gave me the Y and so on