# Help with ClientMessage

**URL:** <https://forums.unrealengine.com/t/help-with-clientmessage/280538>\
**Category:** C++\
**Tags:** getting-started-with, unreal-engine, UE4, CPP, question\
**Created:** [April 14, 2014, 5:33am UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538 "2014-04-14T05:33:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jadaith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jadaith](https://forums.unrealengine.com/u/jadaith)\
**Post date:** [April 14, 2014, 5:33am UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538/1 "2014-04-14T05:33:04Z")

</div>

I’m new to C++ and the Unreal Engine and I have a problem on getting the ClientMessage to work. I’ve looked at the wiki and various examples on how its used but I still get the error that its undefined. Can someone help me understand how to get the Clientmessage to work?

Here is a example of my code.

void ATestTimer::Tick(float DeltaTime)  
{  
Super::Tick(DeltaTime);

```
float test;

test = 0;

ClientMessage(test);

test += DeltaTime;
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("Hello World!")); 

if (test > 5)
{
	TimeNumber = 10;
}

```

}

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [April 14, 2014, 5:08pm UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538/2 "2014-04-14T17:08:25Z")

</div>

#PlayerController

ClientMessage is for the player controller class only

you have get a reference to the PC or be in the PC class to use it

🙂

Rama

---

<div class="post-metadata">

**Author:** ![jadaith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jadaith](https://forums.unrealengine.com/u/jadaith)\
**Post date:** [April 14, 2014, 5:28pm UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538/3 "2014-04-14T17:28:52Z")

</div>

Ok thanks! I will try it out.

---

<div class="post-metadata">

**Author:** ![jadaith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jadaith](https://forums.unrealengine.com/u/jadaith)\
**Post date:** [April 14, 2014, 10:51pm UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538/4 "2014-04-14T22:51:07Z")

</div>

I’m still missing something that I’m unsure of, I know I’m to reference it in the .h file and I tried to use “class PlayerController;” but that isnt working either.How exactly do I reference the PlayerController?

---

<div class="post-metadata">

**Author:** ![intronaut](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/intronaut/32/465475_2.png) [@intronaut](https://forums.unrealengine.com/u/intronaut)\
**Post date:** [February 14, 2015, 7:45pm UTC](https://forums.unrealengine.com/t/help-with-clientmessage/280538/5 "2015-02-14T19:45:10Z")

</div>

If this still doesn’t work, try adding a HUD. A few days ago I had the same problem and then someone pointed out that it “outputs the message to HUD” according to [the documentation page (click)](https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/APlayerController/ClientMessage/index.html)
