Enemies move when I see them.

Greetings, I am doing my UE4 game and I faced some difficulties. In my concept all Enemies can move ONLY when I see them. So if I turn away, they stop. Any ideas how to make it possible?

Yes, quite simple.

Subclass the CharacterMovementComponent and in it’s tick add

// CharacterOwner is a pointer to your character that owns the component.

void UCNWCharacterMovementComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
	if (!CharacterOwner->GetMesh()->bRecentlyRendered)
	{
		return;
	}

	//Call Default CharacterMovementComponent
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}