After applying changes of this lesson, I get crashed Unreal with nullptr error. If I revert all changes, it plays without any problem.
What is the code that causes the nullptr error?
There’s an update to my situation. To understand, where did I screw everything up, I added nullptr check. Smth like (if BehaviorAI = nullptr){UE_LOG(yada-yada-yada, TEXT(“BT is offline”))}. As I understand it, I was getting crashes because I forgot to implement this nullptr check. Now, it turns out, my BP_AIShooter controller can’t see Behavior Tree, which I guess the reason, why it was giving me a middle fing… Unexpected behavior, I mean. And that’s kinda strange, as I have my BT set in editor. Fun thing, if I run BT in BP it works alright.
Could you provide the full function you have that in? It’s a bit hard to understand without context.
And could you post the crash report?
And the line of the AI shooter that the crash report says caused the issue?
I suppose so. I mean, somehow, even when I chose the right BT in editor, it still didn’t see it. First it was causing nullptr, but I didn’t have the check coded, so it was throwing crashes I’ve sent you. After check addition I was 100% sure that AIController just doesn’t see the BT. It keeps throwing nullptr (at least according to check), even though Character is possessed by my AIController and said controller uses my BT.
I suppose I was unclear, I was asking what line this is talking about
As it is cut off in the image.