Belven
(Belven)
April 6, 2016, 8:15am
1
After updating my game to use 4.11, my AllyAIController stopped receiving the Tick() calls but the subclass BaseAIController still does?
#pragma once
#include "Mech_RPG.h"
#include "AllyAIController.h"
#include "Characters/Mech_RPGCharacter.h"
#include "Group.h"
#include "Weapons.h"
#include "AI/Navigation/NavigationSystem.h"
AAllyAIController::AAllyAIController() : ABaseAIController()
{
}
void AAllyAIController::Tick(float DeltaTime)
{
if (UMiscLibrary::IsCharacterAlive(GetAIOwner()) && GetAIOwner()->GetDemandedController() == nullptr)
{
if (GetPlayerControlledLocation() != FVector::ZeroVector)
{
float dist = FVector::Dist(GetPlayerControlledLocation(), GetAIOwner()->GetActorLocation());
if (dist > 1800.0F)
This file has been truncated. show original
I also believe that this is affecting my player controller:
#pragma once
#include "Mech_RPG.h"
#include "Engine.h"
#include "Mech_RPGPlayerController.h"
#include "AllyAIController.h"
#include "Characters/Mech_RPGCharacter.h"
#include "UI/QuestDisplayUI.h"
#include "Interactable.h"
#include "UI/ItemUI.h"
#include "Weapons.h"
#include "Quests/QuestManager.h"
#define mCanSeeLocation(location) UMiscLibrary::CanSee(GetPlayerControllerOwner()->GetWorld(), GetPlayerControllerOwner()->GetActorLocation(), location)
AMech_RPGPlayerController::~AMech_RPGPlayerController()
{
UMiscLibrary::SetPlayerGroup(nullptr);
}
AMech_RPGPlayerController::AMech_RPGPlayerController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
This file has been truncated. show original
Belven
(Belven)
April 7, 2016, 12:33pm
2
I’ve tried several different methods to get this working but without any success. It’s currently stopping my AI and player controller working at all.
Has no-one else had this issue?
Belven
(Belven)
April 10, 2016, 7:40am
3
So turns out that not all my classes were calling Super::BeginPlay(). Took me a whie to work out that, that was the issue but if anyone else has this problem, make sure you call the base classes BeginPlay()
It was a basic mistake… but it was happening to me too… thanks!
this saved my life thank you
Dgriz1
(Dgriz1)
March 15, 2023, 10:28am
6
Thank you, I just made this mistake and this solved it!