Behaviour tree: Can't find file for asset

Hello,

Today when I build my project I suddenly received Load Errors saying some of my behaviour trees “Can’t find file for asset” /Script/BehaviourTreeEditor. This however is not for all my behaviour trees which makes it even stranger…
Because of this error I can no longer see my nodes in the tree and make any adjustments to them…, they do still work.

Can anybody help me with this problem.

Thanks in regards,

Falko

Any technical details you could spare would be helpful. Like UE4 version you’re using, if you derived your project from any of the samples, etc.

If the editor works fine for some of your threes, and not for others then that’s not the “missing editor” problem. I’d guess it has something to do with order of loading things. Do you have any BT assets’ references in your blueprints, in default properties or construction script?

Try surrounding the bit that’s using PlayerPawnBPClass with if (HasAnyFlags(RF_ClassDefaultObject) == false) I’ve got a feeling it will help :smiley:

Unreal Engine version: 4.5.1
The project is not derived from one of the samples
And I tryed something that I found online, which was making an change in Engine/Config/BaseEditorUserSettings.ini. Here I changed bBehaviorTreeEditor to True but that didnt help.

Yeah im using

static ConstructorHelpers::FClassFinder PlayerPawnBPClass(TEXT(“/Game/Blueprints/AIBlueprints/AllBlueprints/AIPiano”));
if (PlayerPawnBPClass.Class != NULL)
{
EnemyClass = PlayerPawnBPClass.Class;
}

At certain controller classes because I want to get the blueprint in my Active function to spawn the enemy…

If that is the problem, how can I get the blueprint for in my SpawnActor function

APawn* NewPawn = GetWorld()->SpawnActor(EnemyClass, SpawnLocation, SpawnRotation);

Yeah this indeed solved my load errors :slight_smile: Thanks, but now that that I have a post up I might aswell ask something else related to this.

In my project I want an object to turn into an AI enemy with certain behaviour, now I have 2 skeletol meshes + behaviours to check if for example the players comes near the object to transform it. Is there an more efficient way to do this ? Cause if I import the object as an Static Mesh im not allowed to check if the player is near and transform it or am I wrong ?

For reference, the answer here is: do not use ConstructorHelpers::FClassFinder in your default object’s (the CDO) constructor. You can restrict code to not be called for the CDO by putting it in if (HasAnyFlags(RF_ClassDefaultObject) == false) block.

You can create a class deriving from AStaticMeshActor, both in C++ and Blueprint, and have extra logic in it.
If you have more questions please open a new thread.