How can you remove the crosshair in game

I want to remove the crosshair in game. I am doing this in the blueprints shooter game. how do you remove it?

If I’m reading you right, you are using the First Person Shooter Blueprint Template, if so, open the “MyHud” (Content Browser: Game\Blueprints\MyHud) Blueprint and disconnect the Draw Texture from the Event Receive Draw HUD:

Or you could just delete all those nodes. Either way, it will remove the cross hair. I found this by searching for “cross” in the content browser (in the Game folder), then using the right click menu and finding references to the texture that looked like the cross hair being drawn

Shooter game is C++ based, I do not think you can change the crosshair unless you are prepared to trying and re-compile shootergame, and this requires you have VS2012 set up and are familiar with C++ coding.

Are you compiling your own version of shootergame?

#The C++

DrawCrossHair() is a function in ShooterHUD.cpp

Looking through the code I did not see any way that is built in to modify the crosshair without changing c++ code.

If you want to alter the crosshair behavior I believe you will have to modify this function

void AShooterHUD::DrawCrosshair()
{
	AShooterPlayerController* PCOwner = Cast(PlayerOwner);
	if (PCOwner)
	{
		AShooterCharacter* Pawn =  Cast(PCOwner->GetControlledPawn());
		if (Pawn && Pawn->GetWeapon() && !Pawn->IsRunning() 
			&& (Pawn->IsTargeting() || (!Pawn->IsTargeting() && !Pawn->GetWeapon()->bHideCrosshairWhileNotAiming)))
		{
			const float SpreadMulti = 300;
			AShooterWeapon_Instant* InstantWeapon = Cast(Pawn->GetWeapon());
			AShooterWeapon* MyWeapon = Pawn->GetWeapon();
			const float CurrentTime = GetWorld()->GetTimeSeconds();

			float AnimOffset = 0;
			if (MyWeapon)
			{
				const float EquipStartedTime = MyWeapon->GetEquipStartedTime();
				const float EquipDuration = MyWeapon->GetEquipDuration();
				AnimOffset = 300 * (1.0f - FMath::Min(1.0f,(CurrentTime - EquipStartedTime)/EquipDuration));
			}
			float CrossSpread = 2 + AnimOffset; 
			if (InstantWeapon != NULL)
			{
				CrossSpread += SpreadMulti*FMath::Tan(FMath::DegreesToRadians(InstantWeapon->GetCurrentSpread()));
			}
			float CenterX = Canvas->ClipX / 2;
			float CenterY = Canvas->ClipY / 2;
			Canvas->SetDrawColor(255,255,255,192);

			FCanvasIcon* CurrentCrosshair[5];
 			for (int32 i=0; i< 5; i++)
			{
				if (MyWeapon && MyWeapon->UseCustomAimingCrosshair && Pawn->IsTargeting())
				{
					CurrentCrosshair[i] = &MyWeapon->AimingCrosshair[i];
				} 
				else if (MyWeapon && MyWeapon->UseCustomCrosshair)
				{
					CurrentCrosshair[i] = &MyWeapon->Crosshair[i];
				} 
				else
				{
					CurrentCrosshair[i] = &Crosshair[i];
				}
			}

			if (Pawn->IsTargeting() && MyWeapon->UseLaserDot)
			{
				Canvas->SetDrawColor(255,0,0,192);
				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Center],
					CenterX - (*CurrentCrosshair[EDirection::Center]).UL*ScaleUI / 2.0f,
					CenterY - (*CurrentCrosshair[EDirection::Center]).VL*ScaleUI / 2.0f, ScaleUI);
			}
			else
			{
				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Center], 
					CenterX - (*CurrentCrosshair[EDirection::Center]).UL*ScaleUI / 2.0f, 
					CenterY - (*CurrentCrosshair[EDirection::Center]).VL*ScaleUI / 2.0f, ScaleUI);

				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Left],
					CenterX - 1 - (*CurrentCrosshair[EDirection::Left]).UL * ScaleUI - CrossSpread * ScaleUI, 
					CenterY - (*CurrentCrosshair[EDirection::Left]).VL*ScaleUI / 2.0f, ScaleUI);
				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Right], 
					CenterX + CrossSpread * ScaleUI, 
					CenterY - (*CurrentCrosshair[EDirection::Right]).VL * ScaleUI / 2.0f, ScaleUI);

				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Top], 
					CenterX - (*CurrentCrosshair[EDirection::Top]).UL * ScaleUI / 2.0f,
					CenterY - 1 - (*CurrentCrosshair[EDirection::Top]).VL * ScaleUI - CrossSpread * ScaleUI, ScaleUI);
				Canvas->DrawIcon(*CurrentCrosshair[EDirection::Bottom],
					CenterX - (*CurrentCrosshair[EDirection::Bottom]).UL * ScaleUI / 2.0f,
					CenterY + CrossSpread * ScaleUI, ScaleUI);
			}

			if (CurrentTime - LastEnemyHitTime >= 0 && CurrentTime - LastEnemyHitTime <= LastEnemyHitDisplayTime)
			{
				const float Alpha = FMath::Min(1.0f, 1 - (CurrentTime - LastEnemyHitTime) / LastEnemyHitDisplayTime);
				Canvas->SetDrawColor(255,255,255,255*Alpha);

				Canvas->DrawIcon(HitNotifyCrosshair, 
					CenterX - HitNotifyCrosshair.UL*ScaleUI / 2.0f, 
					CenterY - HitNotifyCrosshair.VL*ScaleUI / 2.0f, ScaleUI);
			}
		}
	}
}

Rama

I am trying to setup a way to toggle the crosshairs in the template. I have two custom functions, one for enable and one for disable. How do I go about disabling the crosshairs. Im not sure if I am doing this in the correct way.