I used to be able to see my projectiles spawn from my weapon’s muzzle until I updated to 4.9 a while back. I have been ignoring the issue for a while, but now it is becoming annoying. I have not changed any of the projectile’s code within it’s c++ class, so I am not sure what changed in 4.9 that caused it to be invisible. I have even tried creating a new projectile blueprint based of the same parent c++ class, but it still has the same issue which is telling me something happened in my c++ class.
Here is the constructor method for my projectile class, perhaps I am missing something right in front of face. (Hopefully so!)
ABullet::ABullet(const FObjectInitializer& ObjectInitializer)
{
//Object constructor
PrimaryActorTick.bCanEverTick = true;
//Bullet mesh and damage
Mesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Mesh"));
Damage = 10;
//Bullet collision sphere
ProxSphere = ObjectInitializer.CreateDefaultSubobject<USphereComponent>(this, TEXT("Proxsphere"));
ProxSphere->InitSphereRadius(5.0f);
ProxSphere->BodyInstance.SetCollisionProfileName("Projectile");
ProxSphere->OnComponentBeginOverlap.AddDynamic(this, &ABullet::OnBulletHit);
RootComponent = ProxSphere;
//sound effects
SoundEffect = ObjectInitializer.CreateDefaultSubobject<UAudioComponent>(this, TEXT("Sound Effect"));
SoundEffect->AttachParent = RootComponent;
SoundEffect->bStopWhenOwnerDestroyed = false;
SoundEffect->bAutoActivate = false;
// Use a ProjectileMovementComponent to govern this projectile's movement
ProjectileMovement = ObjectInitializer.CreateDefaultSubobject<UProjectileMovementComponent>(this, TEXT("ProjectileComp"));
ProjectileMovement->UpdatedComponent = ProxSphere;
ProjectileMovement->InitialSpeed = 3000.f;
ProjectileMovement->MaxSpeed = 3000.f;
ProjectileMovement->bRotationFollowsVelocity = false;
ProjectileMovement->bShouldBounce = false;
}
Any help or suggestions for debugging would be greatly appreciated.