Print text from actor to log

I want to print something to console.
So I am using the code:

UE_LOG(LogTemp, Warning, TEXT(“Your message”));

(i do it every tick! =D)

But how to see the text “Your message” in console?

The question is - ** how to see somewhere at least something printed from actor class. **

===========Edited=============

I created

class FINAL2_API AMyPlayerController : public APlayerController
{

GENERATED_BODY()


virtual void BeginPlay()  { 

	ClientMessage("Yes this function did run11!");
}

virtual void Tick(float DeltaSeconds) {
	ClientMessage("Yes this function did run22!");
}

};

then I added it(as it is “script”) to my actor.

It is compiled, but nothing happens during the game. There is a still no message on the screen or in the in-game console(`).

Maybe I’m misunderstanding what you mean by “Console” here.

Are you referring to the console that you open up with the tilde key (`) ? If so, you will need to use PlayerController::ClientMessage().

Or are you saying that you don’t see a console window when running the game? If so, you need to specify in the launch options in Visual Studio that you want to launch the console as well. This can be done by appending “-LOG -ConsoleX=50 -ConsoleY=25” where ConsoleX and ConsoleY sets the position where the upper left corner of the console window should be.

UPDATE

After you’ve updated your question, I suspect that your PlayerController class isn’t being used at all.

Did you specify in your Project Settings that the default Controller class should be your PlayerController?

The other way of doing this is setting this in your GameMode’s constructor, e.g.

.h

APWNGameMode(const FObjectInitializer &ObjectInitializer);
virtual void StartPlay() override;

.cpp

#include "YourPlayerController.h"
...
AYourGameMode::AYourGameMode(const FObjectInitializer &ObjectInitializer)
	: Super(ObjectInitializer)
{	
	// Set default classes to use
	PlayerControllerClass = AYourPlayerController::StaticClass();
		...
}

void AYourGameMode::StartPlay()
{	
	Super::StartPlay();
	.. log and other stuff
}

Hello,

If you’re talking about wanting to see Log Text inside of the editor itself, you need to go to Window->Developer Tools-> Output Log. This is where the text that will appear whenever it is told to print (in your case, on Tick).

Have a great day

Another thing, always remember to call “Super::Tick(DeltaTime)” when overriding a Tick function unless you explicitly want to ignore all parent class Tick functionality.