Need help turning a blueprint draft into C++

Can someone please help me turning this blueprint draft into c++

I give you most universal hin ( i assume you know basics of C++):

Most blueprint nodes (except flow nodes which need to be translated to C++ syntax) are direct function bindings from C++, name should be the same just without spaces and Target pin type tells you which class function comes from. With static function (without Target pin) you need to google the name without spaces and ■■■ “ue4 api” to reduce results.

AS i suppose you are new to UE and C++ i will give you the code, it would be :

auto capsule = GetCapsuleComponent();
	if(capsule->IsSimulatingPhysics())
	{
		TArray<AActor*> overlapingActors;
		capsule->GetOverlappingActors(overlapingActors, ABlackHole::StaticClass);
		if(overlapingActors.Num()>0 && capsule->IsOverlappingActor(overlapingActors[0]))
		{
			capsule->SetSimulatePhysics(false);
		}
	}

but your nodes are redundant, you check if the first actor overlaping the capsule is overlaped by the capsule, the second check part can be safelly removed i think :

auto capsule = GetCapsuleComponent();
	if(capsule->IsSimulatingPhysics())
	{
		TArray<AActor*> overlapingActors;
		capsule->GetOverlappingActors(overlapingActors, ABlackHole::StaticClass);
		if(overlapingActors.Num()>0)
		{
			capsule->SetSimulatePhysics(false);
		}
	}

gave you good advices, also you have to know some blueprint function are not just c++ like in this exemple, but they are part of the Kimset2 library (blueprint helpers ) you can still call them from c++ and are prefixed by “K2_” but most of them are just wrapper for blueprints nodes and it’s better to use the none prefixed one if it exist

Thank you very much for the advice and the code, I only started to learn c++ in UE and know basics so this one got a little bit confusing for me even though its kinda simple code.

Thank you for the advice