I am attempting to spawn an actor with UWorld::SpawnActor, and it isn’t setting the actor’s translation.
Using the code:
const FVector BulletLoc = this->GetActorLocation() + (BarrelOffset);
UE_LOG(LogTemp, Log, TEXT("BulletTrans: %s"), *BulletLoc.ToString());
ACBaseBullet* newBullet = World->SpawnActor<ACBaseBullet>(BulletClass, BulletLoc, FRotator());
I can successfully spawn the actor, but when I print out the location of it within the spawned actor’s BeginPlay:
UE_LOG(LogTemp, Warning, TEXT("ActorStartLoc: %s"), *this->GetActorLocation().ToString());
I consistently get (0.0, 0.0, 0.0).
What’s the deal?