# UE 5.1.1 AIController Tick stop working

**URL:** <https://forums.unrealengine.com/t/ue-5-1-1-aicontroller-tick-stop-working/1139433>\
**Category:** C++\
**Tags:** aicontroller, unreal-engine, question, CPP\
**Created:** [April 24, 2023, 3:13pm UTC](https://forums.unrealengine.com/t/ue-5-1-1-aicontroller-tick-stop-working/1139433 "2023-04-24T15:13:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedHawk006](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/redhawk006/32/88714_2.png) [@RedHawk006](https://forums.unrealengine.com/u/RedHawk006)\
**Post date:** [April 24, 2023, 3:13pm UTC](https://forums.unrealengine.com/t/ue-5-1-1-aicontroller-tick-stop-working/1139433/1 "2023-04-24T15:13:04Z")

</div>

Hello everyone.  
I have a problem with my Tick function inside the C++ AIController. It was working correctly, then suddenly its stopped and I don’t know why.  
The Tick function is not doing anything, even a log is not printed out. Everything that I write inside this function, is not executed.

I already checked my BP where I set the AIController, the option “Start with Tick Enabled” and “Allow Tick Before Begin Play” and is all set correctly.  
This is the code in .cpp file:

```auto
#include "MyAIController.h"

#include "Kismet/GameplayStatics.h"
#include "MyCharacter.h"

void MyAIController::BeginPlay()
{
	Super::BeginPlay();

	AActor* playerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
	SetFocus(playerPawn);
	//MoveToActor(playerPawn, 200);

}

void MyAIController::Tick(float DeltaSeconds) {
	Super::Tick(DeltaSeconds);

	AActor* playerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
	MoveToActor(playerPawn, 200);
}

```

Code in .h file:

```auto
#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "MyAIController.generated.h"

/**
 * 
 */
UCLASS()
class MYTESTGAME_API MyAIController : public AAIController
{
	GENERATED_BODY()
public:
	virtual void Tick(float DeltaSeconds) override;

protected:
	virtual void BeginPlay() override;	

};

```

Thanks for the help in advance
