# UgamePlayStatics (name followed by '::' must be a class or namespace name)

**URL:** <https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178>\
**Category:** Pipeline & Plugins\
**Tags:** unreal-engine, Visual-Studio, CPP, question\
**Created:** [December 27, 2018, 11:24pm UTC](https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178 "2018-12-27T23:24:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_4760d377](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4760d377](https://forums.unrealengine.com/u/anonymous_user_4760d377)\
**Post date:** [December 27, 2018, 11:24pm UTC](https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178/1 "2018-12-27T23:24:04Z")

</div>

Hi I am trying to make an AI enemy. I am using this tutorial [Unreal Engine C++ Tutorial - Stealth Game AI - YouTube](https://www.youtube.com/watch?v=3Z1A825gTA8) and I am running UE 4.21.1 and Visual Studio Community 2017 version 15.9.4. In my AIPatrolController.cpp file is compiler giving me an error that name followed by ‘::’ must be a class or namespace name. I tried to include “Kismet/GameplayStatics.h” but it didn’t help.

```
#include "AIPatrolController.h"
#include "AIPatrol.h"
#include "AIPatrolPoint.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "BehaviorTree/BehaviorTreeComponent.h"
#include "BehaviorTree/BehaviorTree.h"
#include "Kismet/GameplayStatics.h"

void AAIPatrolController::Possess(APawn * Pawn)
{
	Super::Possess(Pawn);
	
	/*Get reference to the character*/
	AAIPatrol* AICharacter = Cast<AAIPatrol>(Pawn);

	if (AICharacter)
	{

		if (AICharacter->BehaviorTree->BlackboardAsset)
		{
			BlackboardComp->InitializeBlackboard(*(AICharacter->BehaviorTree->BlackboardAsset));
		}

		/*Populate patrol point array*/
		UGamePlayStatics::GetAllActorsOfClass((), AAIPatrolPoint::StaticClass(), PatrolPoints);
	
		BehaviorComp->StartTree(*AICharacter->BehaviorTree);
	}
}

```

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [December 27, 2018, 11:27pm UTC](https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178/2 "2018-12-27T23:27:38Z")

</div>

It’s `UGameplayStatics` not `UGamePlayStatics`, in C++ names of all entries are case sensitive.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4760d377](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4760d377](https://forums.unrealengine.com/u/anonymous_user_4760d377)\
**Post date:** [December 28, 2018, 6:39am UTC](https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178/3 "2018-12-28T06:39:01Z")

</div>

Yes It worked. It was stupid mistake.

---

<div class="post-metadata">

**Author:** ![bestbushcraft](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bestbushcraft](https://forums.unrealengine.com/u/bestbushcraft)\
**Post date:** [July 31, 2025, 6:12pm UTC](https://forums.unrealengine.com/t/ugameplaystatics-name-followed-by-must-be-a-class-or-namespace-name/440178/4 "2025-07-31T18:12:15Z")

</div>

> [@anonymous\_user\_4760d377](#):
>
> Hi I am trying to make an AI enemy[.](https://allfantasynames.com/group-chat-names-for-3/) I am using this tutorial [Unreal Engine C++ Tutorial - Stealth Game AI - YouTube](https://www.youtube.com/watch?v=3Z1A825gTA8) and I am running UE 4.21.1 and Visual Studio Community 2017 version 15.9.4. In my AIPatrolController.cpp file is compiler giving me an error that name followed by ‘::’ must be a class or namespace name. I tried to include “Kismet/GameplayStatics.h” but it didn’t help.

Yes It worked. It was stupid mistake.
