I have a Projectile C++ class.
I made a Blueprint class deriving from it in order to make my Rocket actor.
FIRST PROBLEM (StaticMesh)
The Rocket has a StaticMesh component and a SphereCollision component. The latter is supposed to detect collision with a Player
I wanted my StaticMesh not to collide with any player (thus, Pawn) inside the World, so I set the StaticMesh collision settings to this:
Note the Pawn that is set to be Ignored
When I put the Blueprint inside the World, these options work.
When I fire my Rocket through the Weapon, they don’t! The StaticMesh still blocks my Player!
One can say that the problem lies right in the fact that I’m spawning something through C++ code… BUT it shouldn’t change my collision settings!
This is the code I use to spawn a projectile
FTransform SpawnTM(MyOwner->GetMesh()->GetSocketLocation((FName("WeaponSocket"))));
AProjectile* Projectile = Cast<AProjectile>(UGameplayStatics::BeginDeferredActorSpawnFromClass(this, ProjectileClass, SpawnTM));
if (Projectile)
{
Projectile->Instigator = Instigator;
Projectile->SetOwner(this);
Projectile->InitVelocity(ShootDir);
UGameplayStatics::FinishSpawningActor(Projectile, SpawnTM);
}
SECOND PROBLEM (SphereCollision + Event)
My Projectile class has a OnProjectileStop delegate, which is called whenever the ShereCollision component is blocked by someone
It works fine when I shoot the Rocket through the weapon.
But when I put the Blueprint of the Rocket inside the World and run towards the SphereCollision, the Engine crashes with a fatal error!
Log file of the crash: [link text][3]