Hi all,
I hope you are all being safe and well during these crazy COVID times, looking forward to the full release of UE5! Though, at the moment I’m creating a new character controller for UE5 using C++ and all the sudden I’m running into an issue, that I did not have before in UE4.26/ UE4.27.
I’m getting the following C2397 error on the line containing :
const float Target{ Delta.Yaw / Deltatime };
Error Log:
ShooterAnimInstance.cpp(153): [C2397] conversion from 'T' to 'float' requires a narrowing conversion
ShooterAnimInstance.cpp(153): [C2397] conversion from 'T' to 'const float' requires a narrowing conversion
Full snippet of the function.
void UShooterAnimInstance::Lean(float Deltatime)
{
if (ShooterCharacter == nullptr) return;
CharacterRotationLastFrame = CharacterRotation;
CharacterRotation = ShooterCharacter->GetActorRotation();
const FRotator Delta{ UKismetMathLibrary::NormalizedDeltaRotator(CharacterRotation, CharacterRotationLastFrame) };
const float Target{ Delta.Yaw / Deltatime };
const float Interp{FMath::FInterpTo(YawDelta, Target, Deltatime, 6.f)};
YawDelta = FMath::Clamp(Interp, -90.f, 90.f);
}
Is there a major change in compiling UE5, compared to version 4? As this same code was running perfectly before… Or is there something I’m missing in the declaration of the variables…
Kind regards,
n00b