UE5 | MBP M1: UE_LOG is not printed

Following the book - Unreal Engine C++ the Ultimate Developer’s Handbook, and trying to print message in Tick function, but it never get printed.

And I try to switch the game mode in settings, no help. Struggle with this problem 1 hour still no clue what is wrong.


PrimaryActorTick.bCanEverTick = true;

Is a declaration to the engine that the Actor “SHOULD” have a tick function that if tick is enabled can be called, but that is not what triggers the Tick() to be called.
try adding

PrimaryActorTick.bStartWithTickEnabled = true;

and see if that works

if you go into the details window (for C++ defined actors this can be hidden in instances so check the blueprint) of the Actor and search for “Tick” one of the options is Start with Tick Enabled see if that is true.

Thanks for reply my op.

I add this line PrimaryActorTick.bCanEverTick = true; but it doesn’t solve the problem, still no UE_LOG printed in Tick function.

And I’m pretty new to UE, I guess you want me to check this Async Physics Tick Enabled in FirstActor details tab. And I check it, still without luck.

Also I add breakpoints in Tick function and BeginPlay function, when I press Play Game in UE, it doesn’t trigger those breakpoints in Xcode.

it should be in a section labeled “Actor Tick” if you don’t see that section then it is not visible there.
open the blueprint for the actor. in the content drawer there should be a blueprint for it. it will have a blue line by default
the directions your following should have something to the effect of

  • navigate to the “C++ classes” folder in the Content browser, and find the FirstActor
  • right click then select “Create Blueprint class Based on FirstActor”
  • in the menu that comes up give it a name, and select a folder to put it into
  • go to that folder in the Content Browser, and drag it into your level

if it skipped steps 2 and 3 then this is only for very special classes that we never want to access the stuff Marked UPROPERTY(EditDefaultsOnly) which things like Tick settings are labeled that way, so you would never get access to them by just dragging out the naked class instance (as well as you would not be able to perform visual scripting through blueprints on that class.

I don’t have blueprint, so I created one as you mentioned above. And after drag this blueprint into my level. Sorry but still no fix.

Please let me go over my step again:

  • Create a blank level Game project with C++, Desktop selected.
  • Create FirstActor C++ class from Tools -> New C++ classes...
  • Add PrimaryActorTick.bStartWithTickEnabled = true per your advice.
  • Create blueprint of FirstActor by the steps you mentioned above.
  • Drag and drop created blueprint into current level map.


just to be sure, in your project directory go to Saved/Logs/[ProjectName].log
this file might be a little large (especially if something is being written on a non-constrained Tick() )
just to be sure in your Text Editor search for “Waring” and again something happening on Tick with nothing else going on should be a wall.

I am unfamiliar directly with what looks like XCode (I am not fully up to speed on Mac) but are you sure you are using Build+Run or are you just using Run?

  • sometimes IDEs don’t build unless you tell them too, so just doing Run will use the last Built thing.

on most PC IDEs Build is like Ctrl+B (so on Mac it should be something like Command+B) but I am guessing on the Keybind

Hi, yes. I do build in Xcode first to apply any changes in the code to UE Editor, then Play the game in UE Editor. I used to be an iOS dev, and comfortable with Xcode.

Basically, I didn’t do any further steps. I’d check this log to see if there is something unusual, and post it here after today’s day work done, thanks for the reply again:)

And on a second thought, maybe change to another IDE to see if it could fix this problem.
I could see UE5 support Xcode by default enabled, and also Clion and VS Code.

I was able to put the code you provided

UCLASS()
class MyGame_API AMyFirstActor: public AActor
{
	GENERATED_BODY()
public:
	AMyFirstActor(){
		PrimaryActorTick.bCanEverTick = true;
		PrimaryActorTick.bStartWithTickEnabled = true;
	}
	
	virtual void Tick(float DeltaTime) override
	{
		Super::Tick(DeltaTime);
		UE_LOG(LogTemp, Warning, TEXT("DeltaTime: %f"), DeltaTime);
	}
	
protected:
	virtual void BeginPlay() override
	{
		Super::BeginPlay();
	}
};

into a .h I was using for just some Structs. after building engine recognized it, I was able to make an instance of it in the world, and it fired to the log every frame (for the project I was working in ~.01)

at that point the only reason it wouldn’t be running your code is if it wasn’t compiled in the editor, or maybe you are filtering out Warning for some reason (in the output log there is a filter make sure Warning is true)

your book won’t cover the topic for maybe a while but in the .h for your AMyFirstActor put in either a public or protected block

	UFUNCTION(BlueprintCallable, Category=MyGame)
	void MyFunction()
	{
		UE_LOG(LogTemp, Warning, TEXT("The Function got called"));
	}

then in the blueprint of the MyFirstActor you should be able to just right-click and search for “My Function” if that doesn’t show up then the engine is not getting your code. which is either UnrealHeaderTool/UnrealBuildTool is not parsing for reflection and engine binary generation, or the Binaries are not working.

have you done similar to the steps listed here?

I can confirm the filter is all good. And I will put this function into FirstActor.h to see if UE could get the changes. After my day job, thanks for helping.

I just added this My Function block in .h file and build successfully. But right click on blueprint, I cannot find the search item.



if you were not able to see the function in the search list Inside the blueprint Event Graph

Open the Blueprint then go to the Event Graph (if the Editor declares it to be a “Data Only Blueprint” then there is a blue underlined button to get the full view)
go to the Event Graph and right click anywhere in the graph and it should show up just by typing “My”

if this doesn’t happen then your IDEs build is not linked with Unreal Header Tool or Unreal Build Tool as that is responsible for the reflection needed for Blueprints to read your headers and have the stuff work.

meaning the solution to your problem is to go through and make sure you have setup the linkage with Unreal header Tool and Unreal Build Tool. Where I don’t have direct experience with these steps on Mac then I posted a link to Official Docs “Mac Quick Start Guide” earlier in this thread (most the other stuff I can find is before Unreal implemented the Metal Integration to Apple Silicon architecture.

Yes, it seems IDE is not connected with UE5, please see screenshot in below. Don’t know why but I will check this linkage stuff.

Thanks for your patience to answer my question.