Howdy Everyone,
I am following along in this course (which is difficult due to how quickly the instructor jumps through things), and have double-checked my code with the Git commits, and have everything the same. However, whenever I click the LMB while the game is running, I get the correct FIRE!!! in the console, but the tank turret jumps clockwise after almost every shot. I initially thought it might be an issue with this code:
void APawnBase::RotateTurret(FVector LookAtTarget)
{
FVector StartLocation = TurretMesh->GetComponentLocation();
FRotator TurretRotation = UKismetMathLibrary::FindLookAtRotation(StartLocation,
FVector(LookAtTarget.X, LookAtTarget.Y, TurretMesh->GetComponentLocation().Z));
TurretMesh->SetWorldRotation(TurretRotation);
}
Perhaps with the computation of the Z coord? Is this jumping expected behavior? Thanks!
Rich S.