I’m having a huge issue with not being able to getting my characters Location without Spawning actor I just want to get the variable without having to spawn it. here’s my code I have
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "SideScrollerConcept.h"
#include "CorruptBot.h"
#include "CorruptAI.h"
#include "SideScrollerConceptCharacter.h"
ACorruptBot::ACorruptBot(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
AIControllerClass = CorruptAIClass;
}
void ACorruptBot::Tick(float DeltaTime)
{
float Distance;
ASideScrollerConceptCharacter *MyCharacter = //HERE IS WHERE I NEED HELP;
if(MyCharacter != NULL)
{
Distance = FVector::Dist(this->GetActorLocation(), MyCharacter->GetActorLocation());
if (Distance < 100)
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, TEXT("OH HAI"));
}
}
}
Any Ideas?