I’ve been trying to snap my objects to ground. To do this I calculate object’s height to ground by using linetraces. Then I adjust Z location of actor accordingly. However, some object have bounding boxes (i am not sure if this is the correct term) which are not aligned with their static meshes. For example:
This cube mesh has a perfectly fine box, you can see its box with red lines.
But this chair object has box like this (you can see it is snapped to ground correctly according to this box):
I added these boxes according to UStaticMeshComponent of objects like this:
Box = NewObject<UBoxComponent>(CurrentActor); Box->SetBoxExtent(CurrentActor->MeshComp->Bounds.BoxExtent);
How can I fix this without editing in 3D software? Is there a reason why it is like this? I downloaded this chair object from marketplace. The problem here is that boxes are not persistent so I cannot simply offset Z location according to box size.