//I figure out how to aim but now I need to set the camera transform back to the old location. Any tips?
void AWeaponBase::IsAiming()
{
ACharacter* Player = Cast(UGameplayStatics::GetPlayerCharacter(this, 0));
bisAiming = true;
FViewTargetTransitionParams Params;
const FTransform SocketTransform = WeaponBaseMesh->GetSocketTransform(FName(“ADS_Socket”));
//const FRotator SocketRotation = WeaponBaseMesh->GetSocketRotation(FName(“ADS_Socket”));
if (bisAiming)
{
Player->FollowCamera->SetWorldTransform(SocketTransform);
bisAiming = false;
}
}
void AWeaponBase::IsNotAiming()
{
ACharacter* Player = Cast<ACharacter>(UGameplayStatics::GetPlayerCharacter(this, 0));
const FTransform SocketTransform = Player->GetActorTransform();
if (!bisAiming)
{
Player->FollowCamera->SetWorldTransform(SocketTransform);
bisAiming = true;
}
}