Help with ClientMessage

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;
}

}

#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

:slight_smile:

Rama

Ok thanks! I will try it out.

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?

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)