Path Node Variable - Unable to pull value upon spawn

Here are some things I did. After watching Shadden’s Basic AI training video, I implemented a BP system of following a PathNode system of say 10 path nodes. The AI follows the nodes in numerical order, unless the hero comes within 500 units for the AI, at which point the AI chases and attacks the Player. If the player gets more than 500 units from the AI, The AI returns the the next path node he was originally traveling towards.

The issue here is that when I have the AI spawn, this system no longer works. I reproduced the issue in a clean project with the same results. On the AI character (EnemyCharacter) I have a variable, “DesiredNode”. This variable “DesiredNode” works with a variable “NextNode”, that resides inside the Actor PathNode What happens is when you place an AI into the world and start the game, The AI_Controller looks for the first PathNode, “DesiredNode” and then looks for “NextNode” and so on down the list.

I set up an spawner to spawn 3 AI into the game when it starts. So when an AI spawns, the value of the variable DesiredNode comes up “None”. The AI goes nowhere.

So today I set up a GetAllActorsOfClass calling the PathNode as the array. And this works, the AI run to the first pathnode, but then stop. I’m stumped.

I am no coder for sure, but I’m trying. I’m an artist. I’m an animator by trade. Animated the for 5 years. Learning Unreal. Its awesome. The only scripting I know is MEL from Maya.

Any insight or help would be appreciated more than you know.

here is one more image of game play from the Top Down view. Working on this mostly by myself, with the help of a few great Unreal people out there. You know who you are. Thanks!

Hello MaroonersRockAnimation,

I took a look at your blueprints and my initial thought would be that the issue lies with how begin play is being used. It may be possible that your character is being spawned after begin play is called and so that first bit of the blueprints are not being called. Would it be possible for you to provide the clean project that you used in your screen shots so that I could take a closer look?

Pathing.rar

Hey , here it is. Please let me know when you download it so I can take it down. Thanks for this!

I have downloaded the project, feel free to take down the link.

OK great thanks!

After digging through your project I was able to find that you are not setting the initial value for the “Desired node” for the other actors that are being spawned in. Also, the fact that begin play is used for the initial value was casing issues. I set up a custom event to fire off on spawn. I have provided a screen shot of the changes I made to help clarify. I hope that this information helps.

Example:

Make it a great day

Thanks for taking the time , I really appreciate it!