# Registering Player Character to Crowd Manager

**URL:** <https://forums.unrealengine.com/t/registering-player-character-to-crowd-manager/472267>\
**Category:** Character & Animation\
**Tags:** detour-crowd-ai-cont, unreal-engine, question\
**Created:** [October 1, 2020, 8:13pm UTC](https://forums.unrealengine.com/t/registering-player-character-to-crowd-manager/472267 "2020-10-01T20:13:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Outsiders\_Edge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Outsiders\_Edge](https://forums.unrealengine.com/u/Outsiders_Edge)\
**Post date:** [October 1, 2020, 8:13pm UTC](https://forums.unrealengine.com/t/registering-player-character-to-crowd-manager/472267/1 "2020-10-01T20:13:18Z")

</div>

Hey I’m trying to register player character to CrowdManager but calling this function from bp does not work. Any idea what should I do?

.h

```
public:
	UFUNCTION(BlueprintCallable)
		virtual void RegisterAsAgent();

```

.cpp

```
void ACoreAgentCharacter::RegisterAsAgent()
{
	UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this);
	if (CrowdManager) 
	{
		CrowdManager->RegisterAgent(this);
	}
}
```

---

<div class="post-metadata">

**Author:** ![Charles\_Sultan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Charles\_Sultan](https://forums.unrealengine.com/u/Charles_Sultan)\
**Post date:** [April 3, 2023, 10:53am UTC](https://forums.unrealengine.com/t/registering-player-character-to-crowd-manager/472267/2 "2023-04-03T10:53:44Z")

</div>

ACoreAgentCharacter should inherit from ICrowdAgentInterface and redefine theses functions:  
FVector ACoreAgentCharacter::GetCrowdAgentLocation() const  
{  
return GetMovementComponent()-\>GetActorFeetLocation();  
}

FVector ACoreAgentCharacter::GetCrowdAgentVelocity() const  
{  
return GetMovementComponent()-\>Velocity;  
}

void ACoreAgentCharacter::GetCrowdAgentCollisions(float& CylinderRadius, float& CylinderHalfHeight) const  
{  
GetMovementComponent()-\>UpdatedComponent-\>CalcBoundingCylinder(CylinderRadius, CylinderHalfHeight);  
}

float ACoreAgentCharacter::GetCrowdAgentMaxSpeed() const  
{  
return GetMovementComponent()-\>GetMaxSpeed();  
}
