Not getting LogTemp to Output Log

In Crypt Raider’s Deferencing & Arrow, I’m not getting any output to the log. I’ve compiled the code, then press play, but nothing happens.
Here is my mover.cpp code

#include "Mover.h"

// Sets default values for this component's properties
UMover::UMover()
{
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
	// off to improve performance if you don't need them.
	PrimaryComponentTick.bCanEverTick = true;

	// ...
}


// Called when the game starts
void UMover::BeginPlay()
{
	Super::BeginPlay();

	// ...
	
}


// Called every frame
void UMover::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	AActor* Owner = GetOwner();

	float MyFloat = 5;
	float* YourFloat = &MyFloat;
	float FloatValue = *YourFloat;
	UE_LOG(LogTemp, Display, TEXT("YourFloat Value: %f"), FloatValue);

	UE_LOG(LogTemp, Display, TEXT("Mover Owner Address: %u"), Owner);
}

I believe it’s a very simple error but my eyes just cannot find it.

Well I went back a couple lessons and redid everything. Now it worked well.
The only thing I did different in the 2nd time was that I compiled in VSCode with CTRL+ALT+F11 instead of compiling in the Unreal. Could that make the difference?

Anyway, problem solved by myself and this can be closed.

I think you meant Ctrl + Shift + B? As that shortcut is for live coding within Unreal.

Could but doesn’t seem likely here. Live Coding is a way to compile the code whilst existing .dll is in use. Typically when you compile, the output (.exe, .lib, .dll) isn’t already in use and it’ll just overwrite it (or create it if it doesn’t already exist). If you have the project open in Unreal it can’t overwrite it as it’s in use so it basically creates a new one and hot swaps to it which can be a source of bugs.

Well I had the VSCode window active. The Unreal application can then take commands even when it is not in the foreground.
So that means that there was no difference between my earlier attempt then.

Since the code was identical on both attempts, I probably ran into a bug. Anyway I got around it so no problems anymore.

Oh and my Unreal version is 5.1.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms