Hi
I got weird problem with my turret. Its sometime rotating in wrong direction
What can be wrong with my code?
void UTankAimingComponent::MoveBarrelTowards(FVector AimingDirection)
{
auto BarrelRotator = Barrel->GetForwardVector().Rotation();
auto AimAsRotator = AimingDirection.Rotation();
auto DeltaRotator = AimAsRotator - BarrelRotator;
Turret->Rotate(DeltaRotator.Yaw);
Barrel->Elevate(DeltaRotator.Pitch);
}