TRASHCLASS BTTask after recompiling player pawn

Hi guys,

I have an enemy AI with behavior tree and BTTasks, including BTTask_Attack.

When I play the game in editor, it works fine. However, since a certain point in development, whenever I open player pawn blueprint, edit and then recompile it - game crashes upon start if the ai pawn with the behavior tree is on the map. Here is a screenshot with an assertion error and stack trace.

Seems like after recompiling player pawn blueprint, BTTask_Attack turns into TRASHCLASS. Why? What should I do to prevent that? I have tried re-making Attack task class, destroying old one. However, the new class as well turns to TRASHCLASS.

Ok, I fixed the issue.

My BTTask_Attack was taking BB entry, getting actor out of it, casting actor to PlayerCharacter pawn and then calling method of that pawn class.

And that’s what caused a cyclic reference error

I replaced casting with interface call. Works fine now.

Pls fix this kind of stuff ASAP, it’s annoying :frowning: