AICharacter MoveTo do not move character anywhere in standalone game mode [possible bug]

Ok, I have this rrrrrrealy wierd thing going on.
I have few NPC’s derived from ACharacter.
I’m moving them around with AAIController->MoveToLocation(). Overall this thing works fine, I know how to get all the controlles, how to find needed NPC from a bunch etc.

But today I’ve rewrited few methods and suddenly found out that NPC’s not moving.
Trying to figure this out, I started Editor from Visual Studio, then first started game with standalone mode - nothing. Then started it in a preview window, to check code step by step. And the’s when character moved. Ok, I closed editor, that ran under VS debugger and tried again in self-sustained one.
But I found out, that my NPC wouldn’t move only when I start it in standalone mode! In other modes it worked.
After that I cleared Binaries, thought this might help, but no, It all started over again.

I realy don’t get what could be wrong, so here’s my code, maybe someone could help or reproduce if it’s a bug:


// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once

#include "dayFlow.h"
#include "GameFramework/GameMode.h"
#include "TheBarGameMode.generated.h"
class ATheBarGameMode : public AGameMode
    // this is a collection of structures with spawned NPC references and their ID's, see definition in dayFlow.h
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "NPC")
    TArray<FNPC_Class> NPCs_in_Bar; 


USTRUCT(BlueprintType) // Char comes event ID=1
struct FNPC_Class
	int NPC_ID;
ACharacter * Char_Ref;
class THEBAR_API UDayFlow : public UBlueprintFunctionLibrary

	// returns reference to specific spawned actor
	UFUNCTION(BlueprintCallable, Category = "NPC")
	static ACharacter* GetNPCReference(int Char_ID, TArray<FNPC_Class> NPCs_in_Bar);

	// moves character to certain location,
	UFUNCTION(BlueprintCallable, Category = "Events")
	static bool executeEventMoveToLocation(FEventCharMoves moveEvent, TArray<FNPC_Class> NPCs_in_Bar);


ACharacter* UDayFlow::GetNPCReference(int Char_ID, TArray<FNPC_Class> NPCs_in_Bar)
	return NPCs_in_Bar.FindByPredicate([Char_ID](FNPC_Class & item) {return item.NPC_ID == Char_ID; })->Char_Ref; // returns NPC reference;

bool UDayFlow::executeEventMoveToLocation(FEventCharMoves moveEvent, TArray<FNPC_Class> NPCs_in_Bar)
	ACharacter* NPC = GetNPCReference(moveEvent.char_ID, NPCs_in_Bar);

	// spawns default controller (if not, there is no controller for NPC to control)

	// cast controller recieved in NCP in Bar Class, derived from AAIController class
	ABarNPCAIController * moveController = Cast<ABarNPCAIController>(NPC->GetController());
	if (moveController == nullptr) return false;

	// moves character to location defined by TargetLocation component of moveEvent	
	return true;

So, what is going on here. When NPC spawnes at my location I pass it’s reference to NPCs_in_Bar struct aswell as it’s unique ID.
When I need to move certain NPC I find that NPC in array of all NPC’s spawned by it’s ID, with GetNPCReference() methid, which returns it’s reference.

What I do is, put blueprint node executeMoveToLocation in gameMode blueprint, plug NPCs_in_Bar array into it and a FEventCharMoves struct which only includes character ID and an FVector targeted location.

Oh, yeah, and I forgot to mention. I track succession of move requests with AAIController::OnMoveCompleted() method and it returns nosuccess, when It dosen’t move and vice versa. So move commands appearantly reach AI, but why wouldn’t it move?

ok, further investigation showed that moveToLocation just fails, I’ve checked navmesh, checked that I recieve correct character reference, all seems fine. Just MoveTo for some reason fails. I’m frustrated.

Furthermore, I’ve added additional move request inside OnMoveCompleted() with condition if move fails and now it works every time, only when It’s called from OneMoveCompleted. It’s a workaround, I could live with it, but that is just wrong.

Workaround didn’t work, hehe. As soon as I added few functions to custom class inherited from AAIController, so I could recall moveTo aslong as it is not succeeded it first started failing casting Controller class I get from NPC reference, and now It just crashes even though It still works just fine in VS builded mode.
Another thing I’ve noticed, when I started from VS my character stood on a ground, and from Editor it flew above. I’ve changed NavMesh Vertical compensation, but still nothing.
This is quite a headache I must say. Gonna try package project and see what I can get from that, but with very little hope.