How to convert this blueprint in c++?

Hello guys, I’m trying to achieve an outline effect on an actor and i found out how to do this in blueprint, but i’m stuck trying to do it in c++.
I want to achieve this in c++ :

283496-as.png

I have to specify that this blueprint is made in the Level blueprint, so my c++ code should be in the GameModeBase c++.

c++ equivalent of level blueprint is LevelScriptActor. You can check out this tutorial for info.

Solus Level Blueprint

First off, I recommend doing the bulk of your work in Blueprints for quicker iteration. The trade-off to use cpp instead of bp is not good if you aren’t already good with cpp, and are still learning the engine.

That said, here is how you write those screenshots in cpp.

First Screenshot:

APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);
if(IsValid(PlayerController))
{
	PlayerController->bShowMouseCursor = false;
}

Second Screenshot:

APlayerController* PlayerController = UGameplayStatics::GetPlayerController(this, 0);

if(IsValid(PlayerController))
{
	FHitResult HitResultUnderCursor{};
	
	if(PlayerController->GetHitResultUnderCursorByChannel(ETraceTypeQuery::TraceTypeQuery1, true, /*out*/ HitResultUnderCursor))
	{
		AActor* HitActor = HitResultUnderCursor->GetActor();
		AOutlineActor* OutlineActor = Cast<AOutlineActor>(HitActor);
		
		if(OutlineActor != nullptr)
		{
			OutlineActor->CreateOutline();
		}
	}
}

I apreciate your effort but i have to ask, where is the the part with the ‘left mouse button’ ?

Here’s three pages in the documentation that should help with handling Player Input: