I tried it and is not working the way I want it. It translates the object and rotates 90 one frame. https://youtube.com/watch?v=FToE_wszlN4
I am trying to achieve what is in the video. I am asking about the math behind it, I am currently learning Vector math.
FVector CubeOrgin;
FVector CubExtents;
GetActorBounds(false, CubeOrgin, CubExtents);
FVector NewLocation = GetActorLocation() + Box->GetForwardVector()*CubExtents.X;
FRotator NewRotation = GetActorRotation() + FRotator(90.0f, 0.0f, 0.0f);
FTransform newTans = FTransform(NewRotation, NewLocation);
FTransform Trans = FTransform(NewRotation);
Box->AddLocalTransform(newTans);