Hey , that primitive component was supposed to be StaticMeshComp, bad copy and paste there :). Its the mesh component on the projectile itself.
As you can see from the logging the force is definitely doing something initially, otherwise it wouldn’t be moving in X and Y at all in those first 4 Position outputs.
From those log outputs, I am writing the value of ForceVec ( “force X=-1985.258 Y=-242.294 Z=-6.573 applied” )… This code itself is running outside the object after it is spawned.
I also changed instead of using force, to add a projectile movement component and set the ForceVec as the velocity and setting the velocity on it like so:
AActor* SpawnActor = (UGameplayStatics::BeginDeferredActorSpawnFromClass(this, ClassToSpawn, SpawnTransform, ESpawnActorCollisionHandlingMethod::AlwaysSpawn));
if (SpawnActor)
{
SpawnActor->Instigator = Cast<APawn>(HolderOwner);
SpawnActor->SetOwner(HolderOwner);
AUGProjectile* Proj = Cast<AUGProjectile>(SpawnActor);
if (Proj)
{
Proj->MovementComp->Velocity = ForceVec;
}
UGameplayStatics::FinishSpawningActor(SpawnActor, SpawnTransform);
}
This exhibited the exact same behaviour. 90-95% of the actors moved correctly, the others moved for a couple frames then stopped all X and Y movement and fell like they hit an invisible wall.
And the collision on the static mesh was set to overlap all object types. So the fact it seems like its being stopped makes no sense.
Again all actors contained just a static mesh component and in this case a projectile movement component (with their updated component set to the Static Mesh component).
Note I also registered the OnProjectileStop of the projectile movement component which isn;t triggered in this case.