I have this exact same issue with my project and it is super frustrating. Two services in one project on two separate behavior trees. One works great and the other does not. Both services have roughly the same amount of complexity. The only difference is that the Pawn & AIController were programmed in C++ for the one that works, and the one that does not work was done totally in blueprint for quick prototyping - following the same design pattern of having a pawn & and a controller blueprint-derived classes. To be clear: the behavior tree, services, and tasks were all in blueprint…
I’m going to try replacing the classes I have done in blueprint with C++ classes. This really should not change anything at all but is the only interesting difference between the two behaviors. I’ll post back my results but that may be several days. I’m also archiving a copy of my project before and after in case it works so that I can submit it to someone at Epic for review.
Apparently it happens because of a circular dependency in the blueprints. I tried looking at the reference viewer (right click behavior blueprint->referenceViewer) but could not find a circular link myself.
Similar to jjlanley, I have a task that is shared among units but because overriding functions in parent blueprints is broken I had to make a switch case for every thing using the task so I could call the proper implementation. In one case the cast would cause a REINST to appear. But not on any of the other.
Thank you both for your comments. I replaced the cast with an interface and the problem is gone.
But that shouldn’t be the only solution. I hope Epic will fix the blueprint stuff.
Interfaces are a way of associating functions to an actor. Getting the target object you want to send a message to is similar to casting. You will need a way of referencing the actor (ex. Return on a line trace, Get Overlapping Actors etc) just like when you want to cast to an actor, except it will not be dependent on the actor type as to whether you can attempt to call the function.