As the title says. I was writing line by line the crosshair part of the First Person Shooter Template and I get this error: ‘CrosshairTexObj’: undeclared identifier.
In the template it is written as CrosshiarTexObj and I wrote it as CrosshairTexObj but I still get the same error either way. Anybody that can give me a lead?
Edit: Here is the Crosshair.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "RandomHungerOfGames.h"
#include "CrossHair.h"
#include "Engine/Canvas.h"
#include "TextureResource.h"
#include "CanvasItem.h"
ACrosshair::ACrosshair()
{
static ConstructorHelpers::FObjectFinder<UTexture2D> CrosshairTextObj(TEXT("/Game/Textures/cross_cross"));
CrosshairTex = CrosshairTexObj.Object;
}
void ACrosshair::DrawHUD()
{
Super::DrawHUD();
const FVector2D Center(Canvas->ClipX*0.5f, Canvas->ClipY*0.5f);
const FVector2D CrosshairDrawPosition((Center.X - (CrosshairTex->GetSurfaceWidth()*0.5)),
(Center.Y - (CrosshairTex->GetSurfaceHeight()*0.5)));
FCanvasTileItem TileItem(CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White);
TileItem.BlendMode = SE_BLEND_Translucent;
Canvas->DrawItem(TileItem);
}