UE4 - Cant fix condition error from tutorial: Introduction to AI and Navigation - Digital Tutors

Hi, i created a decorator called “Is in attack range” wich performs a condition check before an AI attack, BUT… since many attempts… i haven´t been able to fix this error: Blueprint Runtime Error: “Accessed None trying to read property CallFunc_GetBlackboardValueAsActor_ReturnValue”. Blueprint: BTDecorator_Isinattackrange Function: Perform Condition Check Graph: PerformConditionCheck Node: Return Node

It happens if i run away from my enemy when its attacking me… but i did followed the tutorial step by step, my AI Works fine, i just keep getting tons of error logs.

This is my BP, what is wrong or what can i do to avoid error logs?

Please help, im new to AI behaviors, thanks!

Just use a “Is Valid” after the “Get Blackboard Value as Actor”.

I have followed the same tute as Rocco and have the same problem. I can’t work out how to make the is valid node work. If EvilCleric is still around could you give me a bit more info on how to do this. Thanks

When you use the “Get Blackboard Value as Actor” node, take its output and pass it through an Is Valid Node. You proceed with the logic only if it returns success.

For example, in the above screenshot, before using the Get Actor Location node, you first pass it through the Is Valid Node. This way if your AI doesn’t have a target, it will not try to access its properties.

Thanks for the reply. This is what I did and I’m not getting any errors. Is that what you meant ?

e

Exactly. You can also connect a false/unticked Return Node to the “Is Not Valid” output since the target is not in range.

Probably not the place for this post but have got no response as a new topic so I thought I’d give this a go.

I have made an Enemy AI that begins in the world. I have also made a BP Patrol Path .The Enemy AI has an exposed variable called Patrol Path. Once the Enemy AI is placed in the world I can select my patrol path (BP Patrol Path ) from my exposed variable (Patrol Path).

This works fine but I want the Enemy AI to be spawned into the world at a certain point. I have looked at ways to get my Enemy AI to recognise the patrol path upon spawning but cannot work it out.

In short, I need my exposed variable, Patrol Path to select my BP Patrol Path when the Enemy AI spawns into the world ?

*This image is from the details panel of my Enemy AI when selected in the editor window. How I would like it to be when Enemy AI is spawned.

*This one is from within the Enemy AI Blueprint with the variable Patrol Path selected.

Don´t destroy your AI, just make it invisible, spawning AI´s is a heavy dutty for UE, it affects framerate, just make it invisible, make it appear when enemy is at certain radious, if player kills it, just make it invisible and hide it, turn it off and then make it go back to the original location, you can also use a delay, to avoid player making it visible until X time has passed, belive me, this is the best aproach after you already have more than 200 AI´s in-game, wich BTW is the behaviour Tree limit before reaching a point where AI´s start failing, the best way is keep them hidden, and turn them on, only when its necesary, also turn their ticks off once they are dead.

Thanks for getting back to me Rocco. Much appreciated and I will follow your advice. I never really thought to simply make it visible and invisible. Great solution and will turn its tick off too.

The whole answer hub seems to have gone down. For the last week whenever I click Answer Hub I get a page saying the answer hub is down for maintenance. Is it just my account or is this the same for you ? Cannot find any info on the net about it.

Haven’t tried it last week, but its down for maintenance right now.

Thanks for that.