SpawnActorDeferred
function defers the BeginPlay
, giving a opportunity to the caller to set parameters beforehand, it means, the spawned actor if in a half-way to being full constructed(is a half actor) until the FinishSpawningActor
function is called, wherever it is put; it means, a valid actor instance that didn’t receive BeginPlay
yet and so it is not fully initialized.
Here, Ref_GameBall ->FinishSpawning( Transform )
can be put before to activate the projectile movement, or replacing SpawnActorDeferred
by SpawnActor
:
FActorSpawnParameters SpawnParameters;
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;
Ref_GameBall = world->SpawnActor<APaddleGameBall>(APaddleGameBall::StaticClass(), FTransform(FRotator::ZeroRotator, FVector::ZeroVector, FVector::OneVector), SpawnParameters);
That’s all
Thanks to @KnownBugg, from Discord, to help me with this.