I’m writing a custom movement component and moving a custom skeletal mesh I made in blender using SafeMoveUpdatedComponent
. Here is the main part of the code:
const FVector PositionDelta = CalculatePositionDelta(DeltaTime);
const FRotator RotationDelta = CalculateRotationDelta(DeltaTime);
const FQuat NewRotation = UpdatedComponent->GetComponentQuat() * FQuat(RotationDelta);
FHitResult Hit(1.0f);
SafeMoveUpdatedComponent(PositionDelta, NewRotation, true, Hit);
if (Hit.IsValidBlockingHit())
{
HandleImpact(Hit, DeltaTime, PositionDelta);
SlideAlongSurface(PositionDelta, 1.0f - Hit.Time, Hit.Normal, Hit, true);
}
UpdateComponentVelocity();
The collision behaves as if the physics asset of the mesh was rotated by 90 degrees, even though the debug Collision view shows that it’s oriented correctly, the asset preview looks good as well. When I rotate it by additional 90 degrees then it works as it should, but clearly something is not ok.
You can see it going through a box here:
And here is how it collides when I rotate the main part of the physics asset by 90 degrees.