#Setting up Overlap delegate is not working. Bullets not colliding with walls, but phase through

1 messages · Page 1 of 1 (latest)

minor copper
#

I am having trouble setting up overlap collisions in C++. I'm using this Youtube guide and I'm following it to the letter. https://www.youtube.com/watch?v=Mh3YHTMQjtc&list=PLoReGgpfex3z12PPCPK7W76Y2q1KNQtxH&index=10
In VS, I have this snippet about the "Collision Sphere" CollisionSphere = CreateDefaultSubobject<USphereComponent>(TEXT("Collision Sphere"));

In my BaseProjectile class i have the delegate,
CollisionSphere->OnComponentBeginOverlap.AddDynamic(this, &ABaseProjectile::BeginOverLap);

Unreal has very good tools for visual scripting with blueprint but of course, there's always those who want to write their code. unreal offers scripting in c++. and while that might sounds like a nightmare, it's not as bad as you think. So come along and let's find out all about C++

Join the discord for any help you need! : https://discord.gg/2...

▶ Play video
#

BeginOverlap looks like this;

void ABaseProjectile::BeginOverLap(UPrimitiveComponent *OverlappedObject,
AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex,
bool bFromSweep, const FHitResult &SweepResult)
{

UNiagaraFunctionLibrary::SpawnSystemAtLocation(this,ImpactParticles, GetActorLocation());
GEngine->AddOnScreenDebugMessage(-1,5.f,FColor::Red,TEXT("HIT"));
BulletHit();
Destroy();

}

#

When I spawn a projectile,, it simply phases through the wall despite me hahving ticked "Generate Overlap events" in the wall. What am I doing wrong?