Somehow, if i implement it as shown, my projectiles all fire into a direction, which seem to be worlds local forward vector.
I cannot achieve my shooting with this.
I saw before, that i had to put into the Spawning a rotation too, so my compiler wouldn’t bother around which looks like this now:
// Spawn a projectile at the barrels projectile socket location with that rotation
AProjectile* Projectile = GetWorld()->SpawnActor<AProjectile>(
ProjectileBlueprint,
Barrel->GetSocketLocation(FName("ProjectileSocket")),
Barrel->GetSocketLocation(FName("ProjectileSocket")).Rotation()
);
Debugging this looks quite okay.
But as i tell in the Projectiles Launch method, i have to do something other.
I tried this for now:
if (!GetOwner())
{
auto time = GetWorld()->GetTimeSeconds();
UE_LOG(LogTemp, Warning, TEXT("%f: Projectile Owner is null" ), time)// %s"), time (Get->GetName().ToString()))
return;
}
ProjectileMovementComponent->SetVelocityInLocalSpace(GetOwner()->GetActorForwardVector().GetSafeNormal() * LaunchSpeed);
But as it look, my Owner is null, and i don’t know now how to move on with this !