UE_LOG and BTService?

Hi,

As part of a little debugging I added a couple of UE_LOG lines within the TickNode method;

		if(AIController->LineOfSightTo(PlayerPawn))
		{
			UE_LOG(LogTemp, Warning, TEXT("Has line of sight"));
			OwnerComp.GetBlackboardComponent()->SetValueAsVector(GetSelectedBlackboardKey(), PlayerPawn->GetActorLocation());
		}
		else
		{
			UE_LOG(LogTemp, Warning, TEXT("Lost line of sight"));
			OwnerComp.GetBlackboardComponent()->ClearValue(GetSelectedBlackboardKey());
		}

Nothing appears in the log, yet the behaviour is as would be expected, e.g. the values are being set/cleared etc. Is it not possible to output messages from the services, or, does something else need to be enabled first to do so?

Any help appreciated :slight_smile:

Works fine on my end and I’m not finding anything via Google about this. Could you try a log at the very beginning after the Super call?

1 Like

Hi Dan, sorry for the late reply. I saw your message whilst out today (airsoft with my son) and had an epiphany but wanted to check it out first before I replied.

This issue actually related to my other post for the same lecture regarding where I could get access to those objects once etc… because they were both nullptr, the code in the if statement wasn’t ever run, obviously I hadn’t made the connection previously, so it just looked like the UE_LOG stuff was failing because I had all the code in the CharacterShooter still. Thus the enemy was moving around seemingly acting correctly, but no output logs from the service.

Since changing the code back so that I wasn’t using the constructor or the OnBecameRelevant the UE_LOG output is appearing as expecting!

Thanks again for the reply. :slight_smile:

1 Like

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

Privacy & Terms