I want my flying AI to just fly towards me as soon as it sees me. I have a blueprint for it, but that’s only for units that are on the ground. At least I’m assuming because it doesn’t work with the flying unit. I have no idea how I can attach navamesh to the air, can someone help me with this, thank you very much
The cool thing with flying is that you don’t need navmeshes, because you can just fly straight wherever you want to go.
So, when flying, make your AI controller simply issue a vector/velocity/movement in the direction of the player (or wherever it wants to go.)
If you want to “fly in the air” but follow the navigable space of the navmesh, then you should model your asset to have a standard ground collision, but offset the mesh however far up into the air that you want it to hover. E g, it’ll still “walk,” it’ll just render as if it were flying.
Hello friends
I’m really at my wits’ end when it comes to a flying opponent
So now I’m just trying to program a projectile movement so that it moves in the air in my direction.
My question is, is it possible to tune a projectile to move as soon as it sees me, i.e. with Pawn Sensing?
i upload my Bp image
Because the problem is now taht it moves in my direction but not if he sees so at the begin of the game he starts to move
(I know that’s not the right way for a flying opponent, but I’m still far too new to unreal to be able to do everything without being able to see the whole thing in a video or picture)
There needs to be a loop function (or event dispatch, etc.) that is testing for that condition.
Basically you need to have a function that keeps asking “Is the player looking now?”, and when the player fulfills those requirements to make the statement TRUE, then you would execute the AI movement.
You can look up tutorials on event dispatchers, or create your own loop function.
You have to understand how the tools you’re using behave, and I have no idea what you specifically trying to do.
Projectile movement is just an impulse algorithm, but it may break if you try to use it for anything else than shooting something like an arrow or bullet.
If I were you, I would experiment with these things first.
I actually just want the AI in my side scroller game to start running towards me as soon as it sees me and I can do that perfectly on the floor with the BP that I posted at the very beginning, but as I said, it just doesn’t work in that air
ME—><—Ai afters sees me
What I missed was making my AI from the tutorial:
What he taught me works, but I want the AI to move after it sees me
I’m giving up on it now because I’ve been stuck on it for 4 days. I’ve just placed boxes in the air that don’t move but can be destroyed by my character’s attacks
But thank you very much for your nice tips and try to show me a way
i go for it in the future
now I just used what I can to finish the side scroller…
-ON_PAWN_SENSING → CAST → (Place blue cast pin into “Other Actor” of GET_DISTANCE_TO) → GET_DISTANCE_TO → (Place green output pin to LESS_EQUAL, putting whatever value you want) → (Attach red output node to BRANCH) → (Connect the rest of your MOVEMENT DATA) → BRANCH → MOVE_COMPONENT_TO.