Hi i was wondering if anyone could give me a possible way to make an AI character, move to a single waypoint and then upon reaching said waypoint to wander/ roam freely using Blueprints to achieve this.
If possible i would like this to work through a behavior tree which i currently have created to do the basics, such as wander around the level, if it sees a player PAWN it will chase and if it gets close enough it will attack and then if it looses site of the player PAWN it will return to wandering until it sees the player PAWN again. I also have a basic patrol system set up where it moves between patrol points placed in the level, then updates to move to the next patrol point, but for my current needs i prefer the wander/ roam setup i have. (Note this was all done via tutorials from Unreal forums and you tube, i would not be able to make this stuff on my own without the tutorials)
So just to revise what i want to achieve. I want to create a task where the AI will move to a specified waypoint upon spawning in to the level and then once it has reached the waypoint it will begin to wander/ roam freely around the level. and it should be run through a behavior tree.
Any guidance in how to achieve this will be greatly appreciated.
You can follow up the “BASIC AI” videos from Epic’s Twitch Live even if they are sooooooooo tedious to follow. They are basically doing what you do in the first 3 videos I believe.
Starting with this one:
You can pressed “next” it will bring you to the following videos.
Hey Yun-Kun thanks you for the link, I’ve been slowly making my way through the Tutorials all day. will update this post if i do or if i don’t figure out what i want to achieve.
Have you tried the get random point within radius node? Choose a random point, wander to it, then choose a new random point and wander to that, etc.
I have that working , thats works for my Wander task, but what i mean is, that i want the AI to move to a targeted placed waypoint in the level first and then start moving to random points.
Which i now seem to have working, and I’m not entirely sure how i made it work, the tutorials didn’t show me how to do it, i sort of figured it out whilst watching them.
I have my Waypoint Blueprint, based off the Targetpoint Actor which acts as the targeted waypoint in the level that i place, i then have a BTT_Task which tells the AI behavior tree which waypoint to move to and then in my AI_controller tell it to move to the desired waypoint.
I’ll put some print screens up underneath as i’m not very good at explaining what it is that i did so hopefully the prints should show it better.
AI_Controller BP (further to the left off screen is where i tell it on Event begin play which Behavior Tree to use).
BTT_Task to update the desired waypoint
And the Behavior Tree where on the completion of Moving to the targeted waypoint it then proceeds to the wander task to the right.
I believe your “Waypoint” variable is never cleared, so your BT keeps running the “Move To Target Waypoint” node. Try to clear it in “Moveto then wander”
I’m not sure how to clear it, but currently everything seems to work how i want it to, at the moment i have a new problem which i have started a new thread on.
The new problem is that the AI i have pre placed in the level when i play in editor will move to the Desired waypoint fine, but i have AI that spawn into the level as well from a spawner and they do not move to the desired waypoint, they will do everything else including move to random points within radius and update but they just won’t move to the desired waypoint.
I need to know if it is possible to initialize an AI character to move to a waypoint before it’s created in the level.