Hey there,
I’ve been trying to get my AI Move To node working so this BP_Jailer can move toward the BP_Player, but each time I run it, it immediately fails.
I have the Nav Mesh on the level, the player reference is correct, yet when I run the command, it instantly fails without trying to move towards the player.
All of the collisions on the Jailer have been set to Character Mesh, except for the Hit/Hurtboxes which are set to overlap all dynamic.
I’ve also ran MoveDirectlyToward in the Behaviour Tree and that seems to work fine, but I’m interested in learning why this is failing.
I went through all of those steps and the only thing I haven’t done out of all of them was to set agents in the Project Settings.
I did see a video regarding it but I’m a little confused behind the logic as in the example their asset had an Agent height and my blueprint is set to -1.
I did toy around with some numbers as they mentioned it should be in relation to the radius and different depending on the asset size. These are the numbers I’m working with.
hey, thanks, most of the times, its due to nav mesh not proper or given world location is not valid or problems related to it. can u give 0,0,0 and see if its moving there?
can you create a new level, add nav mesh, put your ai, simulate and see if its success or aborted
can you call this ai move to on begin play so that test can be done without other dependencies?
and, can you share your ai setup? like, what is parent of your ai as sometimes due to collisions of actors of static or skeletal meshes added, ai move to node might not work
If you only have one agent in your project settings, it just uses that one. Note that it uses the settings in your agent set in your project settings. The settings you set in your character don’t matter. At least, not until you have more than one agent. Then it picks the agent in your project settings that’s the closest match. Then it will use the settings in the agent if the settings differ. Again, you don’t need to deal with this if you only have one agent. But it’s something to be aware of if you ever add multiple agents.
Don’t use negative numbers in your project settings for agents.
I haven’t really dabbled in AI stuff a whole lot so sorry if I’m not getting all of what is required. I haven’t made parents for these blueprints - I’ve seen videos about how to do it but I’m pretty deep into this project and don’t want to refactor all of my programming if possible.
It’s just a basic AI Controller - I’ve only really set the behaviour tree on it and added some references to some BT/BB keys
sometimes, collisions added and their collision type also may lead to ai move to not working. what are those 3_1, 3_2 collision? are those box collision? can u do one thing, no need for adding ai controller also, can u create a simple blueprint actor, add a cube, make it parent on left side, now add this same ai move to and it will work, can u test this once? and put somewhere to left or right, so that it can move to 0,0,0
Since you are codding the movement in the NPC/Enemy blueprint with Ai Move to, you do not need to touch the AI controller I think.
You can see on the video I attached, how Ali ezohery shows the simple version of chasing your player (you can ignore the later Ai behavior tree etc stuff) and see what you did different compared to his:
I wish I could tell you what the fix was but I genuinely don’t know. Last night, this wasn’t working, and the only thing that changed was that I changed on the Jailer was that I moved it to 0,0,0 and it worked.
I moved it back, and it suddenly started working with the environment it was in.
For what it is worth, I deleted the agent in project settings, that’s the only thing I could think it might be, but I’m not convinced it is.
Something in this thread fixed my problem but I can’t figure out what it is.
Thank you to everyone who helped regardless - I’m going to try and figure out what happened and I’ll report back if I do.
I guess one thing that wasn’t mentioned is that if it suddenly started working, it could be that the navmesh runtime generation property is set to static. When it’s static, it can be stubborn and not update properly. Force rebuild on load is supposed to update it, but it doesn’t always do so. You can switch it to dynamic and back (or leave it at dynamic) to force it to update.