So, what seems like is going on here in the code is that you’re mixing Latent logic with non-latent logic. When you add a latent command, what that does is fires it off to another thread that is going to eventually do what that command tells it to do, and then the code progresses. I don’t see a level load in here, so is this intended to be run while already within an existing level with an existing player character?
If it’s not, and the test is expected to do all of its setup on it’s own, and you don’t have a character before the start of the test, your latents may all be getting created way too early and as such, none of your characters are getting the movement commands. It’s enqueuing all of these latent commands in a fraction of a second, and your character iterator in MovePlayerTest may be trying to iterate before you have a character, thus telling zero things to move to each location. The fact that you weren’t even getting
UE_LOG(LogEngineAutomationTests, Display, TEXT("Unable to find character."));
to fire implies that your iterator is empty, showing that this may be the case.
What you could try to do is actually put another latent function at the beginning of the queue that is responsible for waiting until your iterator shows a character, and have that function then add all of your other latents once that is done. One that maybe looks like:
bool FWaitForCharacter::Update()
{
for (TObjectIterator<ACharacter> it; it; ++it)
{
ACharacter* character = *it;
if (character)
{
return true;
}
}
return false;
}
Continued in next post…