I use interpolating rotation of the projectile so it would look onto the target point.
Interpolating rotator is my own function
Interpolating angle
Normalizing degrees to [-180, 180]:
double UCoreExtendingFunctionLibrary::DegreesToStandardized(double Degrees)
{
Degrees = UKismetMathLibrary::GenericPercent_FloatFloat(Degrees, 360.0f);
// Holy Emperor knows how this works, but we are definitely in [-360, 360]
if (Degrees > 180.0f)
{
// We got into (180, 360], will go to (-180, 0]
return Degrees - 360.0f;
}
if (Degrees < -180.0f)
{
// We got into [-360, -180), will go to [0, 180)
return Degrees + 360.0f;
}
// We got into [-180, 180]
return Degrees;
}
Update Target Point is called in my gameplay ability in my case, but you can place it where you want as a result of tracing.