BlueprintCallable not working on device

I first came across the issue when creating a behavior tree service. A BlueprintCallable was always returning an empty (but not null) object on my device. But that was just the beginning.

I stripped it back and just created a simple method to test outside of BT…

UFUNCTION(BlueprintCallable, Category = ElementalAI)
FVector VectorCheck();

FVector AElementalAIController::VectorCheck()
	return FVector(100, 100, 100);

Simple, works fine in the editor. Run it on the device? Enter a world of nightmares…

Image1: The output of this is nothing, no on screen message, nothing logged (as a result of the BP print). However, adding a UE_LOG to the code and it prints the expected value.

Image2: Even weirder, when I first tried it attached to the end of existing BP nodes it ran the previous node in an infinite loop (hundreds of “GiveWeapon” logged from C++).

As I said, initially I was returning an object, then tried a vector, also doesn’t work with a float.

It seems so random, sometimes it prints empty values (zero vector, or 0 float, or empty object which passes a not null test). Behaves differently depending where in a BP I place it in the BP chain. C++ logs output expected values but BP just aint working. I tried it on other classes in case my AI class was broken somehow, and still nothing.

I tired it in an empty project with a basic custom AI class and it works on the device.

I want to cry now.

I’m using 4.6.1, Android, Galaxy S5.

Please save me from this torment.

Forever in your debt.

Sort of fixed…
I created a new project, copied all my code and migrated all my assets from the original project and it now work on my device.

Still no idea what caused the problem though.