NPC not moving toward target but moving in opposite direction

I’ve just purchased this, and for a quick test I’ve setup a Pathfinding grid and on one of my NPC Enemy objects I’ve placed the following Scripts: Seeker, AI Destination Setter, and AIPath(2D,3D)

On my grid settings I’ve not included the layer for the enemy on the Mask for Height Testing, and I’ve also not included the layer where the target is.

When I start the scene the gizmos draw a correct path from the NPC Enemy to the target, but the NPC just slowly moves in the opposite direction from the target.

It’s probably something really simple, but I’ve been through the Getting Started Tutorial Video twice and the Written Tutorial once and haven’t found the issue.

More information, so upon further examination it looks like my grid was below the terrain so I’ve raised it up to be above the ground. My terrain isn’t completely flat so I’m not sure how far above the terrain the grid can be.

I did a rescan, and now red cubes fill the entire grid as if none of it is walkable.

Sorry for the noobish questions. I really did try to follow the tutorial.

So I adjusted the height of my grid and rescanned and now I’ve got blue where I would expect it to be, but the NPC Enemy is still slowly gliding in the opposite direction of the target.

This has been resolved.

You cannot have an animator with “Root Motion” checked. I had just an idle animation playing at start, but even that with Root Motion enabled caused things not to work.

1 Like