Colliding with a wall and stoping the actor

So how do I do this with C++. I have to do this with C++ for an assignment and I’m attempting it with box collision.
I have the unfortunate issue of either not knowing what to search for or everyone is just using the easy blueprint method that I am not allowed to use.

I’ve got the following in the cpp file
void AWall::OnBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)

if ((OtherActor != nullptr) && (OtherActor != this) && (OtherComp != nullptr))
{
	

	
}

}

I assume I need something in there. I just don’t know how to get it block anythig from going through.
if it helps I have another active collision issue here with a different class but, setup in the same way.

There is no need to handle a custom overlap event for this, just use sweep. Take a look here: Moving Physical Objects - Unreal Engine
Just make sure that your wall collider has the “Block all” collision profile and sweep the actor that moves towards the wall.

That doesn’t really help. I’m trying to do this entirely with C++ code as well. I can’t just use preset collisions if I can do it with code.

That’s not true, there is nothing that you cannot do with C++. Blueprints and editor aren’t just magical things, they’re writen in C++.
You can set collision profiles for components in C++ using Component->SetCollisionProfileName(“profilename”);

thankyou. apparently I am a moron so thankyou for literally spelling it out. I thought you meant initially to alter the blueprint but, this does make sense.