bool check = UGameplayStatics::SuggestProjectileVelocity
(
this,
OutLaunchVelocity,
ProjectileShootpt,
HitLocation,
LaunchSpeed,
false,
0.f,
0.f,
ESuggestProjVelocityTraceOption::DoNotTrace
);
if (check)
{
UE_LOG(LogTemp, Warning, TEXT(“TossVelocity = %s”), *OutLaunchVelocity.ToString())
auto AimDirection = OutLaunchVelocity.GetSafeNormal();
MoveBarrelTowards(AimDirection);
This part of program when logged out for toss velocity i.e. ‘OutLaunchVelocity’, it produces a negative value for all the 3 coordinates x,y and z. The same goes for the direction cosines of the tossvelocity i.e. ‘AimDirection.’
Although I’m completely sure that there is no issue with the rest of the classes and functions.
I’d like to know why are these values negative. Because I want to change the tank barrel’s orientation based on the value of these numbers.