void MyCharacter::SetCursorDir() {
//note that the line 58-59 is seen pretty common on the internet to find the cursor porjection
//onto the internet, however, they do not give me the right vector.
//FVector CursorWorldLocation, CursorWorldDirection;
//GetWorld()->GetFirstPlayerController()->DeprojectMousePositionToWorld(CursorWorldLocation, CursorWorldDirection);
//=====================================================================//
//gets location of the actor in the world
FVector CurrLoc = this->GetActorLocation();
// the right method of getting cursor location!!! note: i used the exact same method in the Epic Top Down Blueprint.
FHitResult hitResult;
GetWorld()->GetFirstPlayerController()->GetHitResultUnderCursorByChannel(UEngineTypes::ConvertToTraceType(ECC_Visibility), true, hitResult);
FVector hitLoc = hitResult.Location;
//geting the original rotation of the acter;
FRotator newRot = this->GetActorRotation();
//Using atan2 function to get the degree between our character location and cursor location
// aka how much we want the character to rotate
float newYaw = (hitLoc - CurrLoc).Rotation().Yaw;;
//Using that degree as the Yaw(rotating around Z axis) of our Frotator
newRot.Yaw = newYaw;
//in the end, we set it;
// this->GetController()->SetControlRotation(newRot);
SetActorRotation(newRot);
}