AI Perception not moving with character when setting position via Set World Location

Hey all!

I have a scenario where I have both walking and flying enemies. For the walking variety, navmesh is in use and AI Move To is used to navigate. This works fine, and the AI Percpetion component moves with the character by being attached to the AI Controller.

For the flying variety, because I want the enemy to navigate around actually in the air, and not on the navmesh, I’m using Set World Location with a lerp between current location and desired. While this works fine to actually move the character, the AI Perception component does not move along with the mesh, it just persists at the spawn in location. I have tried putting the component on the AI controller and on the actual Character but the same behavior happens on either.

Any ideas on either how to leverage AI Move To for flying, or how to ensure the AI Perception component moves with a flying enemy?

Thanks!

Hey @KungFuBrad!

So the nodes labeled “AI blablah” are specifically for characters (I really wish they’d just change it to “Character blablah”) try using the regular “MoveTo” and try “MoveDirectlyToward” tasks.

Let us know how it goes! :slight_smile:

Hey @Mind-Brain thanks for the ideas!

I tried Simple Move To (in the blueprint), and both the “Move To” and “Move Directly Toward” tasks (was doing this with my Walking variant), but unfortunately both of these are also using the NavMesh, so there is no movement with respect to the Z-axis (flying in the air). All 3 do move appropriately on the Y-axis (just need this one and not X as it’s a 2.5D game).

Any other thoughts?

Thanks!

I see…

I tried to think about it after I saw this and I wonder if you’d get anything from this, take a look at this video and see what you can glean from it!

Disclaimer: This link is not associated with Epic games, Unreal Engine, or their partners.

Cool thanks will give it a go!