Animal AI Won't Move, Idle

Hello, everyone!

I used Matt Aspland’s tutorial for AI Animal Movement (Setting Up The Basic Movement | Part 1 Of Creating An Animal AI In Unreal Engine 4 - YouTube), and my character only stays in place with the idle animation. I debugged by setting the default value from “0” to “150”, and the animal walks in place (without actually changing its location). There’s a gap in my knowledge that is preventing me from fixing this. Here are the relevant blueprints:






Thanks!

Hi there,
Have you placed a navmesh in the level? A navmesh is a representation of all areas that an AI can access.

For animal AI, I strongly recommend the official training from Epic Games, which also includes a sample project for download:

Unreal Engine Livestream - AI: State of Mind - July 25 - Live from HQ - General / Announcements - Unreal Engine Forums

2 Likes

You’ve added a 0-1200 range for speed, perhaps when you trigger the input key to move from 0 to 150 in speed, the character will be still in place.

First off, I’m a fan of yours, so deal with it.
Secondly, I’m going to go heat up my homemade Tikka Masala, Orange Tea, and once the rage is completely out of me, start all over from scratch with your recommended video.

I’ll update you, soon!

1 Like

Great to know I could help you, my friend.
Keep up the good work.

Edit: Matt Aspland is a great UE content creator, so I recommend you going back to his series after finishing the official training.

1 Like

Greetings, once more!

So, I think there’s a step missing that the tutorial(s) assumes we should know on our own, but I’m new, so enlighten me:

Should there be instructions/code in the AIControlled character 's EVENT GRAPH? Because I’ve followed the tutorial to a T, and upon compilation, it stays in idle mode.

BUT

When I apply the code (seen below) to “Move to Actor/Location”, upon compilation the deer moves.

Is there a set of instructions that it needs in its own EVENT GRAPH to access the BEHAVIOR TREE?

Hi there,
You’re moving forward.
Yes, the AI controller can hold code to initialize the Behavior tree in a certain order, assuming that your behavior tree is completed with all branches triggered by appropriated conditions.

Have you examined the sample project yet? The behavior tree will receive notifications from the external events monitored by the AI controller (Enemy on sight, No Enemies, etc). It’s looks like your behavior tree is not completed yet. And a behavior tree follows a hierarchy from the top “Root” to the lower branches passing through the selectors and sequences.

This code you’ve shown is the very basic setup for moving AI. As you’ll see in the Epic’s training, the controller has a logic to monitor the presence of the player, and the “move to location” logic is written in the behavior tree.

1 Like

So, this is my own debug code, just to make sure that the deer can move on its own (following the tutorial, they leave it blank):

“Yes, the AI controller can hold code to initialize the Behavior tree in a certain order,”
Indeed, but will the AI Controller execute automatically, without being called in the Deer’s personal EVENT GRAPH? (To reiterate, the tutorial leaves this section blank).

I’m at the 44 minute mark, and I’m doing this in my own project. Maybe he has some things already set up that I don’t? In which case, I should just keep following along? And eventually the deer will move? Because, with what I showed you, he’s got deer moving about.

Yes, the AI Controller must be assigned to the Deer Character BP, then it will work as a “brain”. You don’t really need to add code to your character BP. Most of the code can be stored between AI Controller and Behavior tree. You are in good hands, Wes is one of the best instructors, Imo. You should keep following his tutorial, as he is going to setup the left branch and the logic inside the AI controller.

Enjoy.

1 Like

Okay. Thank you!

Hello my friend,

Just checking out, are you having good progression?
Keep up the good work.

1 Like

Hey, I hope all is well!

Yes, I went through and it was very successful. Unfortunately he (Wes) seems to have only contributed to the Live this one time (for AI, at least). Very disappointing!

Hi there,
Agreed. Wes is my favorite instructor. Have you seen these series?

1 Like

You’ve destroyed my weekend.

Thank you.

1 Like