I am trying to make my character move to a point on the map on begin play, I have set the goal actor of the character to the first point I want it to move to but it does not move. It has character movement, and I have tested the points to see if they show up in the map and they definitely do. Why will it not move to this first point? I don’t even know if it can move to the next point because it does not move at all
Hey @yerimvlvt, did you make sure to set it up the way I explained here on an older topic of yours?
Also, you shouldn’t continuously execute the move to nodes.
Additionally, can you print out the initial location value of your variable named “Goal Actor”? What happens when you use the Move to Location node and set the destination manually?
Can you confirm that you set the other aspects correctly that I listed in my linked post?
Does the area you want the AI to navigate to show up as green when you press P on your keyboard while focused on the map? Including the current location of the AI and the set destination?
And could you print out the AI controller?
Sorry not sure what you mean by printing the controller, but here is the AI character with the location and the nav mesh
and this is the goal location, which is in front of it
Hey @yerimvlvt! I was just able to launch my PC to test it for myself. I am able to reach the expected result with the same setup.
I think your issue is related to the AI Controller, that’s why I wanned to see what gets printed. So I think you’ll be able to make your AI character move by using the AI Move To
node, since you’d only need to plug Self
into the Pawn
pin of that node.
Now to fix your issue about the AI Controller, could you get a Print String
node and connect it to your Get AI Controller node (That’s connected to Self
)? If nothing gets printed out, then we need to fix that.
Here are some things to consider:
- Make sure that the set destination is in bounds of the Nav Mesh, because it’s not quite clear from the image you provided. You can draw a debug sphere to that location and check it that way.
- Make sure that this setting of your AI character is set to “AI Controller” or your custom AI Controller:
You can also consider creating a new blank project and setting it up there. That way you can compare the differences with your current project, or can migrate your project to the new blank one if you can’t figure it out.
Hope this helps!
Thanks! I just tried to print it and it didn’t seem to work
I also set the AI controller, and the locations are within the bounds!
I’m quite far into this project already, and it is for an assignment that must be completed by the end of this month, so migrating to a new project honestly would be off the table due to the time it would take😅
Yeah if nothing gets printed, that’s what we should look into.
- Are you able to make your AI character move with the
AI Move To
node? Of course that also doesn’t work without an AI controller but maybe there’s a problem with how we get the AI Controller, and that node doesn’t take the controller as input. - Does Begin Play even get called at all? You can check by hitting F9 while the node is selected to toggle a breakpoint. The game should start paused (or when your AI character is spawned)
- What happens when you create a custom AI Controller blueprint and assign it to your AI character like this:
And just out of curiosity, what happens when you set up all of the necessary things in a new blank project? If if does work there, you can try to find what’s different. If you can’t find anything, you can simply migrate all of your assets including your blueprints to the new one! It won’t break anything. Plus, you’re not deleting your current project either. Just make sure to enable all of the plugins you use in your current project in the new project as well before migrating. (Side note, always make sure to connect your project to a version control system even if your project is small. On top of that, manually backing up your project is also necessary to prevent losing any progress)
I tried to look at the image of your map a little closer. It’s not quite clear, but it kinda seems like your AI character is floating and the Nav Mesh is too thin. It might be out of the navigation bounds so if that’s the case, either make the Nav Mesh bounds thicker to also contain the character inside, or bring the character down to the ground.
I’ve just tried to set it up in a different project, and it seemed to work there after tweaking some settings, I went back to my original project and changed the same settings but still nothing happened. Though, I decided to delete the nav mesh and replace it, it seems to work! I wonder what the issue with the previous mesh was. Thanks so much for your help too!!