For anyone having issues with the WieldSword functionality, it's good to know that I didn't show how to edit it to include an animation, but it is the same as the UnWieldSword, so if you want to add that animation make sure to also include an event dispatcher (Call onWieldSword) from your enemy blueprint, and update the task to only Finish Execution when OnWieldSword is dispatched (Just like we did in the SheathSword from 40:45 to 44:20)
@@djtc2093 here I'm referring to the wieldSword task in the behaviour tree, because a lot of people had issues with this, and almost everyone forgot to call finish task (with success true) ONLY when the onWieldSword event is dispatched
can you please add the files for this tutorial please? (if you still have the proj files that is)...still heaving problem with it, after i followed your instruction for debugging the WieldSword functionality
BTW, the problem i had, was in the SheathSword and WieldSword tasks...i was connecting the finish execute to the bind event instead to the finish custom event respectively in both tasks
These are seriously the best tutorials I've come across. No fluff, great pacing, and even though they're over 40 minutes long each, I know they're worth watching bcz you do such a good job explaining everything, and it's not filled with useless information like modeling a character first, or animating something, straight to the point and topic of the tutorial. Thanks for all your hard work making these AI tutorials, they couldn't have come at a better time for me since I'm implementing a combat system right now. You've definitely earned a subscriber.
Hey! Thank you soo much for this comment. It really keeps me motivated when I see that my content is this helpful to people, so thank you for appreciating the effort that went into this 🙏🙏
@@AliElZoheiry I'm a game designer with 25+ years of experience working in various proprietary engines and I'm learning UE for the first time. I cannot thank you enough for putting this video together! Teaching this old dog some new tricks! 🤣🏆🎉
Your tutorials are absolutely insane and I really enjoy watching them. You really find the right balance of digging into topics, tempo and - my personal highlight - level of coding quality. Looking forward to see and learn more from you!
You have by far the best, cleanest, most to the point and easiest to follow tutorials I've seen on here. This is helping me resolve a lot of little things I wasn't quite sure about in behavior trees. Now I finally know the RIGHT way to use them.
Thank you so much for your kind words! I'm really glad to hear that my tutorials are helping you out with behavior trees. Your feedback means a lot to me! If you have any more questions or need help with anything else, feel free to ask.
The thing I love about your videos, is that I can actually absorb the information without have to race the instructor that goes on to do a millions things before you complete what you are doing and understand it... spacing in videos like this is SOOOO important.
Thank you so much for your kind words! I'm really glad to hear that you find the pacing of my videos helpful for absorbing the information. I'll definitely keep that in mind for future tutorials.
Hi, Ali. I am learning so much from your tutorials. I do have one suggestion. Make sure that what you are referring to is visible on the screen. There are many instances where what you are typing is cut off. This is true whether it is in the window or full screen. Thank you for the hard work on these tutorials. This is helping me understand AI.
Thank you, I indeed noticed this in a few other videos, In my latest 2 videos I started only zooming on important details which would otherwise be too small on screen, so hopefully this issue isn't happening anymore
This has really helped me alot I was so scared to get into making ai but you have made it so clear and easy to follow I still dont understand ai but I understand more than I did so thank you so much! I'll be sure to credit you when I make my game!
Look, I'm Brazilian and I understand very little English, but honestly what fantastic teaching, even with little understanding your content is very complete and explanatory, I would definitely buy something from you, you're very good at what you do, you deserve recognition
Thank you soo muchhhh!! im a C++ developer and making a stealth game, sadly the ai documentation is very bad and usually i take the Bp logic and translate to c++ in a optimal way. You r awsome!
Yeah the documentation for C++ is quite lacking, I will be making some C++ tutorials as well soon because some systems are only available in C++ so stay tuned ;)
Thanks for the tutorial series. Very clear and easy to understand. I got stuck for atleast a day trying to move from the "set movement speed" to the "Move along patrol route" stage. Watched the video over and over and couldn't figure it out, added loads of print screens and got nowhere... It turned out that I used a selector instead of a sequence for the patrol state... FML :D onto Episode 3!
Learned so much from the firs episode of this series. I didn't know anything about behaviour trees and after watching the first episode and then practising on my own I am a lot more comfortable with it. Thank you Ali you are my Unreal Sensei, keep up the excellent work :)
Starting this series after completing load and save system which was fantastic. You teaching style is amazing - problem and solution based which i found very helpful in learning process. Just leaving this comment to encourage you to produce more videos in more series especially in multiplayer system login using facebook/google, messenger style chat using dedicated server , and save and load in multiplayer system. Keep up the good work man . Cheers 🎉
Hey, thank you so much for your kind words and suggestions! I really appreciate the support and I'll definitely keep your ideas in mind for future videos. Cheers! 🎉
Im a complete noob and managed to follow this great (yet complexed) tutorial.. I kept leaving comments asking for help but then would follow the logic from what I asked and debug.. Then comment again with a new problem and delete as it changed aha. This is my final comment to say thank you.. Most my issues were to do with leaving a box unchecked or not connecting a pin for example I hadnt connected WeildSword to execute Bind event in the BTT_weildSword and in Sheathe sword so the BT wasn't finishing the task and getting stuck haha.. Having the comments to read through definitely helped me to fill in gaps on parts I had missed or you had done outside of the edit. Thanks for another great tutorial. Took me about 4 hrs as a noob to troubleshoot my mistakes :)
Hey, thanks for sharing your journey with the tutorial! It's really great to see how you were able to troubleshoot and solve the issues on your own. Your perseverance definitely paid off. Glad the comments were helpful, and I'm happy you found the tutorial useful. Keep up the great work!
Amazing tutorials! Learning a lot in here. You just got yourself a new patreon! Can't wait to continue the rest of the tutorials! Keep up the good work!
Thank you so much Twidie 💖 really glad that you are finding my content helpful, and i'm really grateful that you joined my Patreon. I appreciate you 🙏😇
I like that the way you design these, you are using best practices for how you would set it up for an actual game. Most tutorials just focus on getting it functioning superficially for the purpose of the video.
Thank you for your comment! I really appreciate it. My goal is always to make sure the tutorials I create are not only functional but also designed with a real-world game development approach in mind. I'm glad you noticed that! 🙏
I've only been building BluePrints for about 3 weeks and I was able to follow along easily with a few minor debugs needed for my own errors. Thanks for the great work and I look forward to watching the next one in your video list!
That's great to hear! I'm very happy this was beginner friendly as well. The aim for this series is to be beginner friendly while still teaching intermediate and experts a lot of new things.
Loving my journey through these tutorials... I stopped right before the end and was going to add another decorator for "IsFocused" and got hung up a bit... clicked play and 2 seconds later you went into the focus fix 🤣
Thank you teacher Ali. Like part 1 your tutorial are very detail moreover your teaching and how you explain are really amazing. I also consider WieldSword function that didn't show in video as homework. Even now I cant count the spline point and don't know why it need to -1. The Spline point function are the last thing that I cant understand. Also it took me nearly 2 month to understand overall how the function operate, That make me realized how I lack of the foundation [Gonna cry in corner]
for example you have 10 spline point in your patrol spline point index 0 = spline point 1 ... ... ... spline point index 9 = spline point 10 index as defaulf start 0 but your point of number going 1 , 2 , 3...
Hey there! Thank you so much for your kind words and for sharing your thoughts. I appreciate your dedication to understanding the concepts. Don't worry, taking your time to fully grasp the material is commendable, and it's okay to take a bit longer to fully understand everything. Keep going, you're doing great! 🙏 P.S, checkout the response from @DaviesMurphy, it sheds light on how incrementing the spline point works! Thanks for that Davies
For anyone having issues about being stuck in A state of flip-flop, hence not being able to change states. The problem might be the keyboard key. You can try using the enhanced input system. I first had a problem with the "Tab" button, but when I used it with the enhanced input actions, the problem was solved.
Thank you so much for the kind words! I'm glad to hear you enjoy my teaching style. 🙏❤️ Unfortunately I know nothing about making VFX, very far away from my software engineering background
Thank you so much for your kind words! I'm thrilled to hear that you are finding the tutorials helpful. I'll definitely keep them coming. Keep up the great learning!
Hi Ali , im really excited about the series . Im just bum out that sometimes i dont understand your math, especially the Patrol Index. Im trying my best to understand it, had to crush my head. Hopefully ill knock some sense into my own brain :D
Hey Danny, let me try to explain it simply. The patrol index is just the point on the spline that the enemy is currently on starting at 0 (meaning the first point) so when the enemy moves to the next point we need to add 1 to that index (so then the patrol index is equal to 1 which means the enemy is at the second point in the spline) then we need to check if we reached the end of the spline, by checking if the index is equal to the number of points in the spline (but minus 1 because we started at 0 not at 1) then if we reach the end we just start subtracting 1 from the patrol index instead of adding 1 (this we change the direction to be -1) and do the reverse once we reach point 0 on the spline again. Hope it makes more sense now
This zooming in and out all the time is making me seasick. The quality of the sound and video is great you dont need to do all the zooming. Awesome tutorial series, learning a lot!
Hey Kasper, thanks for the feedback, I did indeed realize that the zooming was unnecessary and stopped doing that in the later videos of the series. Glad you're finding it useful ☺️🙏
thank you for your efforts brother. my main language is not english. Selam in Turkey. I solved my problem. Press " 1 " not moving npc. Solution in " BT_Enemy_Base " > BTT_SetMovementSpeed > Movement Speed (in right) > Spritting. Not Idle :) I hope it was helpful :)
OMG, I rewatched the video three times now because some things weren't working correctly and every time I forgot to set the succeed boolean to true in the finish execute note...
This is probably a specific problem I had but an easy fix anyway, my set focus wasn't working so the AI didn't focus on the player before drawing the sword, then I found out that I set the AI rotation settings to Orient Rotation to Movement instead of Used Controller desired Rotation.
So a few things...I'm going to hang with this but you move a little too fast and I think you forgot to show what you did around 41:00 regarding the changes you made to the initial Weird Sword. But so far I'm liking it.
Hey, thanks for your feedback! I indeed didn't show the changes to the WieldSword, because they are exactly the same as the SheathSword event, and I showed the event in the blueprint, so you can pause and see what's happening there if you'd like
In part 1 we built the "BP_Enemy_Base" code (pt 1: 37:00 - 41:07). But it looks like that code got replaced by completely new code, of unknown origin, appearing here in this Part 2 at 8:16. I've spent a week on this tutorial. I've redone this and part 1 a few times now, and I can't get it working. Here's how mine works: Press "1" the first time: Enemy just stops patrolling and stares at me. Press "1" twice: Enemy slides along his patrol zone and continually unsheaths Press "1" third time: Enemy slides, then finally runs and attacks me. Press "1" fourth time: Enemy sheaths a few times and returns to his Patrol Path; the sword never disappears. After tearing out most of my hair, I gave up and downloaded the project zip. When I open that project and play, the Enemy AI faces me, unsheathes, and then runs behind a wall, faces the wrong way, and swings at empty space a few times. Is there a way to get a project download at the point where the action makes sense at the end-point of this video?
Hey Heavenseek, so the enemy blueprint was not completely replaced with something else, as mentioned at 1:14, I just changed the WieldSword event and behavior tree task to include an animation and an event dispatcher, which I proceed to explain at 38:20. It sounds like your problem is likely with the wield sword event and behavior tree task, make sure that in the WieldSword event you dispatch OnWieldSword and in your task you bind to this event dispatcher and only call Finish Execute then, just like we did for the unwield task at 43:55
@@heavenseek Hey man, I found a bug in the engine that might be causing your issue. It happened to me today when I restarted the engine, I found that the Blackboard keys on the "BTT_MoveToIdealRange" in the tree got reset and I had to manually select them again. Meaning that I had to Change the "IdealRadius to be either the AttackRadius or the DefendRadius (depending on whether I'm attacking or strafing) and the AttackTarget set it to AttackTarget as well. Hope this helps
This is exactly what is happening to me. I followed the directions exactly and have gone back through them several times. I can't see where the discrepancy is. I'll take a look at Ali's suggestions here.
you are really best, im deleted my old ai system in only BP and im trying to use now BT. You are best man and you are best man again and you are best best man. Change your channel name to "BEST MAN"
Thank you so much for your kind words and support! I'm really happy to hear that you found my content helpful as you transition to using behavior trees. I appreciate your enthusiasm and encouragement!
The more better way instead of using a Interface or Cast is to Store Data in ActorCOmponent , this is a great feature using which we not only make Less Coupled things but also modular things
Hey Brock, thank you for the feedback. I indeed use actor components heavily later in the series when I start integrating a damage system and attack system
@@AliElZoheiry I see, that's great then and btw I loved your end result that's why I started watching, if you could make a enemy which can predict player moves like attack, flank
Great content so far! My AI has been severely lacking. And, these videos are just what I need. I'm wrapping up for the day. I've only had one issue that I cannot seem to figure out. When I press "1" the first time, everything works great, and I created an UnsheathSword Montage similar as you did, and spawn the sword using a Montage Notify as usual when working with Notifies. But, the Enemy will not turn to face the Player as it unsheathes the sword. It will unsheath, then turn to the Player everytime. I've tried playing around with different things, and I'm not quite sure what is going on. Other than that everything looks great. I've debugged the AI Behavior Tree, and it looks like it flashes by the BTT_FocusTarget(with AttackTarget as the Attack Target Key) and goes directly to the BTT_UnsheathSword I created under the BTD_IsWieldingSword Decorator. That is all within the first sequence. The numbers on the nodes look correct. I'm not sure why it is skipping the BTT_Focus Target Task though. EDIT: For now, I'd just added a Wait 0.5 Seconds Node to the middle of the sequence. So it will Focus wait half a second, then unsheath the sword. This gives the AI enough time to turn and face the player, even if directly behind the AI. Using 5.2.1, but don't think much has changed in this regard.
Thank you! Glad you've been enjoying the content If your AI is taking a long time to turn it could be the rotation speed of the enemy character is slow. If you're not using the default manny character and default settings, make sure to match it to the default manny settings for rotation speed and see if it helps
@AliElZoheiry - Thanks for the tip! I was actually thinking the same thing when I woke up this morning. Oftentimes, I wind up waking up with a proper solution XD Just got in from some morning endurance cycling. I'm going to get going on my projects in a half hour. And, this will be the first thing I test. Adjusting the turning/rotation speed on the ai mesh.
@@Dominicn123 - Sorry. I never did figure out the issue with the enemy not facing the player. I just left in the Wait half a second node to the AI Tree which I mentioned above. At this point I think I'm running off a copy of one of Alizoh's source files I downloaded a while back. I didn't think of looking for the change in the source for that particular issue. When I downloaded the source project, and started working off of that.
Anyone else having issues with "get spline point as world position" at 12:49? I can't get that. Edit. NVM After UE5 Crashing it had not saved the function in BP_PatrolRoute
Thank you so much for your kind words! I'm really glad to hear that you're enjoying the videos. If you have any specific topics or requests, feel free to let me know. Happy learning!
this episode ruined it for me bro, everything was going amazing until this episode, about 3/4ths through the video things began not working right with the enemy, after the whole sheath thing. i followed exactly and went over things three times to ensure no node is incorrectly done, i can see a LOT of others had issues here too, i went on after this video and the other videos are good but this one is the issue one, i know you've defended your edits and actions in the comments but this video seriously desrves a re-do, but go over things completely as you do them, this is the ONE video hurting this entire playlist.. i found this video on reddit, on the UE sub there was about a dozen users who praised the tutorial but warned against part 2 of it, which i ignored because i assumed that i could figure out where they had issues, looks like it got me too, this video is mostly good but had a vital error keeping it from being as polished as your other vids, please re do it bro.
DUDE yes!!!!! I found this on reddit yesterday too but not on that sub, it was from the game devs sub, u/NoFrillaz or whatever shared it but told people to skip the second video because he skipped a lot of steps later on in the vid and it messes up a lot of ppl lol I've been trying to redo things 4 times now and have the exact same issue!!!! it makes me so angry because everything else is SO good!! but darn it
me too I am having trouble with it around that part , my enemy freezes and jitters when supposed to be switching, I agree I wish he can remake it, please Ali
yes bro it was all good until this one, its hard to explain to him about what mine does but reading all the other comments i can see everyone that has issues with this vid, hasthe exact same issue because mine is doing same and it just make me frustrated and i've rechecked everything, please ali it won't take much effort to just redo this one, it will make ur playlist perfectly i've done the following 3 videos after this one and they all are good but the issue on this video has roots that lead and branch out to the after vids.... i've redone this tutorial 3 times now because of this issue, thinking i missed something but no, it's literally all from the sudden addition of nodes later on, even if u mentioned a few changes at the start that doesnt gloss over things, just please redo it in full and show things as you mention them!!! @@BadNewsStudio
i'm having issues too, with the wield sword function part, i know he pinned a comment with a solution but that doesn't quite resolve things in full. i'm hoping for a re-do too haha, i've been stuck on this video for 4 days now
Hey all, just to be clear, there is nothing wrong with the tutorial, you can follow it from start to finish without any problems. The reason I wrote this comment, and the reason you might be having issues, is that event dispatchers, and behaviour trees are a new way of working for most of you, so it can be confusing, but I assure you, the content itself is tried and tested and works perfectly, if you are having issues, feel free to join the Discord server and we have a youtube-help channel there where you can ask your question, provide details, then I or someone else can help you there. Just make sure first to check the existing questions in case you find the solution you're looking for. Good luck 🤞
Really great stuff here! I've been following along trying to do everything here but with State Trees. Would love to see some future content on handling AI with State Trees. Any chance you've got plans to tackle that topic?
Hey there! Thank you for the kind words and suggestion! I've actually been considering doing a series on AI with State Trees, as it's a popular request. Stay tuned!
I just have a question, I want to have a box that spawns the monster when the player collides with it, but when I do that and spawn the monster, it doesn’t have a patrol route selected and I don’t know how to make it come with a patrol route already set. Btw I am spawning a new ai and setting it to the enemy when the box collision happens, it does everything except follow the patrol route if that helps.
Hey there! In order to have the monster spawn with a pre-set patrol route, after spawning it, you will have a reference to the spawned character. Then you can just get the PatrolRoute variable from that reference and set it's value to be the reference of the patrolRoute from your level (you will have to get a reference to that patrol route first though, and how to get that reference will depend on how you built your game)
I followed the steps, but right at the beginning, when the simple test is performed to follow the path, mine stops right at the starting point and doesn't move forward.
Followed this almost 100% and tried to use the instruction on sheath sword to also create and unsheath and it just gets stuck in the behaviour tree in the first branch of the wield sword line...
Common mistakes are: - Typo in the montage notify name (either in the montage or the switch statement off of the play montage node) - You used the wrong type of notify (regular notify instead of montage notify will not work) - You are not pulling off of the NotifyBegin in your play montage node (before the switch statement) - You are not binding correctly to the event dispatcher
I'm asking you a question through a translator because I'm Korean, but I don't know if you can translate it accurately. I have two questions. 1. When the game goes on, the character immediately pulls out the sword, puts it back in, and moves to the spline point. When the game goes on, I want the game to move right away instead of pulling the sword out and putting it back in. How do I fix this? (Solve: Weild Sword was applied to Beginplay.) 2. I've never solved a non-soft animation with a character movement either, is there a way to go to the line instead of spline point? (solve: It was solved when I changed 'use controller rotation yaw' to false. However, if you change the function to false, the character will look in the opposite direction when you press the '2' key. So, in bp_enemybase, 'Set Controller Rotation Yaw' is set to true at the front of FieldSword and false at the front of SheathSword. Also, in bp_enemybase (Self), the default value of 'Set Controller Rotation Yaw' is set to false. Through this method, the original value works as false, true when the knife is taken out, and false again when the knife is moved. I don't know if this is the right method, so if you have a problem like me, please try this method and verify it.) + If the next motion does not occur after drawing the sword, check 'Call On Field Sword' is connected to On Completed in 'Wield Sword'. It took me an hour to find the problem..😂 I've found a solution, but I won't erase it to present a solution to someone with a problem like me.
Thank you for your detailed explanation and providing solutions to your own questions! It's great that you've found a method that works for you. Your willingness to share your process to help others is really admirable. Keep up the problem-solving spirit!
My Enemy is Patroling only 1st point of the spline after reach that point Enemy starts idleing and not patroling anymore. I cant understand what am I missing.
Hello Great Tutorial, I had a problem where i couldnt change the movement speed for the enemy player. It really took me a long time to find my problem: at 19:35 he added the "max walk speed", i mistakenly added "max movement speed". cheers
Hey, thanks for your comment! I'm glad you enjoyed the tutorial and identified the issue with the movement speed. It's great to hear that you were able to troubleshoot and solve the problem. Happy coding! 🙌
I am trying to apply Walk Patroling to my Enemy, but instead of only Walking, some points Enemy is Walking and some points Enemy is Running, Its doing both. Any suggestion.
Hey! If you're points are not evenly spaced out, then the enemy might be accelerating faster and slower depending on your acceleration speed and ground friction and deceleration settings in the character movement component. These all affect how fast your enemy moves
Thanks for these awesome tutorials! I do have one issue with the Blackboard Decorator that is on the CombatState Selector. With it on, the enemy only runs the PassiveState side of the BT. With it off, the enemy will try to move to AttackTarget, but slingshots around the area never actually reaching the player. I don't know what the issue is, but any insight would be much appreciated.
I'm not really sure I understand the issue, but if it is regarding the decorator not succeeding/failing correctly, then I suggest checking the implementation of the decorator and seeing when it returns false/true. Otherwise, some common mistakes are: - Using "Selector" when you mean to use a "Sequence" node - Setting the wrong input parameter to a decorator or task
I'm sorry, I am having trouble assigning the patrol route spline to my character. I can't find any linkable parameters in my BP_Enemy_Base to the spline and your Video is blocking the view at 8:50 Any clues? Great tutorial btw!!! Congrats!!!
Hey Erik, so the "PatrolRoute" variable we created in the enemy class should "Instance editable", which means you need to click on the "eye" icon next to the variable name in your blueprint, or make sure the checkbox for "Instance editable" is checked. Then when you select on your enemy in the World. You can search for that variable in the details panel and assign it the value of your patrol route (which also has to be placed in the world first)
If you still need help you might just need to check inverse condition on BTD_HasPatrolRoute in the Behavior tree but, that's only if your issue was the passive not working
guy be carfull when you name the varible inside the blackboard because it can be valid. do not name the the same name if you have more than one blackboard and also any thing in the engine. For example, when I add blackboard in the selector and press save in behavior tree, it gives me valid and I found out the reason is I have other blackbord key has simmilar name . I just change it
I cant get the keyboardevent 1 key to work. i have gone over everything you have done for 1 hour and its all the same? yet i cant do it? any help please
Hey there! I'm sorry to hear you're running into issues. I'd suggest that you check the keybindings in the project settings. You can navigate to Project Settings > Engine > Gameplay Debugger > Input to ensure that the keybindings are correctly set to the desired keys.
Hi Ali, amazing video as usual, always top tier videos, thanks for your knowledge!! Quick question: i implemented a patrol route for one of my maps, and i spawn allies who will travel through it regularly (moba style). They should go from index 0 to last index, BUT all get assigned the same single patrol route and the patrol index number keeps changing each time i spawn one, so they do not follow 0 -> 1 -> 2 - > ... last index. Is there any way to have them kind of have their own instance of the same patrol route? Thanks in advance and please keep up all the amazing work you do !
Hey there! Thank you for your kind words and for reaching out. This tutorial assumes one patrol route per enemy, not multiple enemies following the same route. The main difference is that the PatrolIndex (which we increment when the enemy moves to the next point) is stored on the BP_PatrolRoute itself, therfore multiple enemies can't share it, because when one moves, the index increments and the other enemy will also read that same variable and move to the same point as the first enemy. To have the patrol route support multiple enemies, you need each enemy to store their own PatrolIndex route, and increment their own copy of that variable
Excelent Video, I have a doubt, in my case my character when he appears on the map makes the animation of drawing his swords, but I want him to not move while he is doing it, so I put a wait at the beginning of the Passive State, it worked but then to advance point o'clock it is also expected, do you know how to make the wait only at the beginning and not repeat itself anymore, thank you.
If your character is doing an action and that action is triggered by a behavior tree task, then you shouldn't Finish the task execution until the action has ended, that's why I added the event dispatcher in the wield and sheath sword functions, to tell the task that the animation is over and you can move to the next node. This is what you should do as well, because a wait node won't work for all animations since they have different timings
aha i for the life of me cant seem to find current index or set current index or idex only the variable but doesnt look to same and cant plug in two variables aha what do i do
Hey there, sorry to hear you're having issues. I suggest debugging the behavior tree to see what node is executing when you press "1" (by looking at the tree while the game is running)
Was going smooth until the enemy stopped attacking on pressing 1, then i tried to find any errors, couldn't, i thought maybe previous files are causing some error so deleted those, thought that by mistake i deleted all the ai folders so closed unreal without saving and now neither the enemy moves to player neither it focuses and neither it attacks 😅 Btw the tutorials are great 👌
Hey! Sorry to hear about the issue you faced. It seems like quite a hassle. Have you tried checking the NavMesh and the AI's blackboard to ensure all references and tasks are set up properly? Thank you for the kind words about the tutorials though! I'm glad you are finding them helpful. 😅
Hi, I wonder is there any way to make the ai follow a specific patrol route when spawned, like for example an ai spawner when the ai is spawned, how to make that ai follow a specific patrol route, thank you. Btw love your vids!!
Great videos @AliElzoHeiry one small thing and im not sure if its covered in a later video but the character jitters a bit in animation when it reaches the spline point. like its deciding whether to keep walking at the next spline point. can this be made smoother somehow or is it just the nature of using splines?
You can play around with the character movement settings, things like declaration and acceleration speeds and friction, etc.. these can help you get a smoother effect
In the tasks should you have an is valid off of controlled pawn? In my case I'm going to have a bunch of zombies. COD zombies style. And in my prototype (where I just used blueprints instead of behavior trees) I'd get all kinds of errors when they died unless I put is valid like everywhere lol
Hey there! It depends on how you implement the death logic. If you unpossess the pawn from the controller, then you should stop the logic of the behavior tree anyway, so it doesn't matter if there is an isValid check. Generally, if you're controlled pawn is ever inValid, then that means you have something else wrong in your implementation, because that case should never occur
45:58 When I press 1, the enemy just runs towards me and uses the Sword_slash montage, but the montage_Sheath_Sword and montage_Unsheath_sword animations don't work, even the BP_sword sword doesn't appear, I checked and followed everyone's comments but still not successful, is there any way, please help me
1. Make sure that you are connecting the skeletal mesh to the montage 2. Make sure there is no typo in the montage notify name 3. Make sure you are using a Montage notify and not a regular notify in your montage asset 4. Make sure you pulling the switch off of "Notify Begin" pin in your play montage node
Just out of curiosity, I'm just trying to make a simple Souls-Like Boss fight, I have the basics for the AI BT you've shown in the 1st episode, I was wondering what videos in order I could watch to get to the final 3 videos without missing anything important. For reference the character I'm following with is the boss I just don't need him patrolling/ hiding to get health if that makes sense? Love the series though and will definitely be coming back to learn more soon! 😄
Hey Darryd, not sure I can tell you which videos to skip because the entire series is built sequentially, so there might be a slight change I make in one video that is used in a later one. What you can do though is check the "chapters" that are timestamped in each video, and they will give you an idea on the contents of that video, then decide whether to skip it or not
These videos are great! I find myself stumbling through UE5, how did you get to the point where you could build behavior trees, tasks and functions on the fly?
Thank you! I'm glad you're finding the videos helpful. Building behavior trees, tasks, and functions became easier with practice and experimentation. I recommend trying out small projects to gradually build your skills and confidence in UE5. Keep experimenting and learning - you'll get there!
I cannot get the NPC to move to spline points. I'm not sure where the breakdown is because the AI debug says it's the current task, but the NPC doesn't move. I went back through the tutorial twice and I don't know what I'm missing. The only thing that I've changed from the original tutorial is I promoted the Acceptance Distance to an exposed variable on the AI Move To inside the BTT_MoveAlongPatrolPath task so I could modify it directly from the main behavior tree, and replaced the Scene Root Actor with a custom sprite billboard that is easier to find among all my world objects - I'm still able to assign the BP_PatrolSpline actor to the NPC, so the reference isn't broken as far as I can tell, and it's not abandoning the task when I put it on a selector to choose between patrolling and chasing, so I have no idea why it won't move. I haven't gone beyond timestamp 15:25 because AFAIK the implementation is broken somehow and it shouldn't be an issue with UE 5.3 - does anyone have any helpful advice for what I could be missing? Any help is appreciated.
Hey, I can't really tell what your bug is just from this description, so I suggest that you add breakpoints or print statements in the patrolPath to see if it's printing the values you expect, that will help narrow down the problem. If you still can't figure it out, feel free to join the discord server and ask your question in the help channel there with more details and screenshots (Link in the description)
For anyone having issues with the WieldSword functionality, it's good to know that I didn't show how to edit it to include an animation, but it is the same as the UnWieldSword, so if you want to add that animation make sure to also include an event dispatcher (Call onWieldSword) from your enemy blueprint, and update the task to only Finish Execution when OnWieldSword is dispatched (Just like we did in the SheathSword from 40:45 to 44:20)
When you say "update the task" - which task or do you mean create a new task for equiping it?
@@djtc2093 here I'm referring to the wieldSword task in the behaviour tree, because a lot of people had issues with this, and almost everyone forgot to call finish task (with success true) ONLY when the onWieldSword event is dispatched
@@AliElZoheiry 100% - thank you.
can you please add the files for this tutorial please? (if you still have the proj files that is)...still heaving problem with it, after i followed your instruction for debugging the WieldSword functionality
BTW, the problem i had, was in the SheathSword and WieldSword tasks...i was connecting the finish execute to the bind event instead to the finish custom event respectively in both tasks
These are seriously the best tutorials I've come across. No fluff, great pacing, and even though they're over 40 minutes long each, I know they're worth watching bcz you do such a good job explaining everything, and it's not filled with useless information like modeling a character first, or animating something, straight to the point and topic of the tutorial. Thanks for all your hard work making these AI tutorials, they couldn't have come at a better time for me since I'm implementing a combat system right now. You've definitely earned a subscriber.
Hey! Thank you soo much for this comment. It really keeps me motivated when I see that my content is this helpful to people, so thank you for appreciating the effort that went into this 🙏🙏
@@AliElZoheiry I'm a game designer with 25+ years of experience working in various proprietary engines and I'm learning UE for the first time. I cannot thank you enough for putting this video together! Teaching this old dog some new tricks! 🤣🏆🎉
Your tutorials are absolutely insane and I really enjoy watching them. You really find the right balance of digging into topics, tempo and - my personal highlight - level of coding quality. Looking forward to see and learn more from you!
Wow! Thank you so much for the support Max. This means so much to me, I appreciate you 🙏😊
This series I by far the best taught content I've watched on Unreal here on CZcams
Thank you so much for your kind words! I'm glad you found the series helpful and well-taught. Appreciate your support!
6.5k views - 222 likes - 104 comments. come on people, don't be so lazy. such minimum effort needed but it means so much to the content creator. 👍
You're absolutely right and honestly it's a really good video.
I don't know how I missed this comment 7 months ago. I really appreciate the support 🙏❤️
You have by far the best, cleanest, most to the point and easiest to follow tutorials I've seen on here. This is helping me resolve a lot of little things I wasn't quite sure about in behavior trees. Now I finally know the RIGHT way to use them.
Thank you so much for your kind words! I'm really glad to hear that my tutorials are helping you out with behavior trees. Your feedback means a lot to me! If you have any more questions or need help with anything else, feel free to ask.
The thing I love about your videos, is that I can actually absorb the information without have to race the instructor that goes on to do a millions things before you complete what you are doing and understand it... spacing in videos like this is SOOOO important.
Thank you so much for your kind words! I'm really glad to hear that you find the pacing of my videos helpful for absorbing the information. I'll definitely keep that in mind for future tutorials.
Hi, Ali. I am learning so much from your tutorials. I do have one suggestion. Make sure that what you are referring to is visible on the screen. There are many instances where what you are typing is cut off. This is true whether it is in the window or full screen. Thank you for the hard work on these tutorials. This is helping me understand AI.
Thank you, I indeed noticed this in a few other videos, In my latest 2 videos I started only zooming on important details which would otherwise be too small on screen, so hopefully this issue isn't happening anymore
This has really helped me alot I was so scared to get into making ai but you have made it so clear and easy to follow I still dont understand ai but I understand more than I did so thank you so much! I'll be sure to credit you when I make my game!
Really happy I could help you Gameboy, I appreciate the support, and looking forward to teaching you more.
@Ali Elzoheiry I'm currently watching and following part 3, and I'll be very excited to see what you do next!
Look, I'm Brazilian and I understand very little English, but honestly what fantastic teaching, even with little understanding your content is very complete and explanatory, I would definitely buy something from you, you're very good at what you do, you deserve recognition
Obrigado! Estou muito feliz que você está achando útil, a sua mensagem me motiva muito. Muito obrigado pelo seu apoio!
مش شايف مصريين كتير يا بشمهندس علي بس بجد أنت فخر لينا أنت من الأخر جاااااامد شكرا ليك جدااا❤❤❤❤
شكرًا جدًا لك! سعيد جدًا إنك استفدت من الفيديوهات 🙏
Thank you soo muchhhh!! im a C++ developer and making a stealth game, sadly the ai documentation is very bad and usually i take the Bp logic and translate to c++ in a optimal way. You r awsome!
Yeah the documentation for C++ is quite lacking, I will be making some C++ tutorials as well soon because some systems are only available in C++ so stay tuned ;)
very well explained, without having much idea of English I understood everything! For the following videos, thank you very much! greetings from BCN
Hey Sergi, thank you for the support, I'm very happy you found this useful ☺️🙏
Thanks for the tutorial series. Very clear and easy to understand.
I got stuck for atleast a day trying to move from the "set movement speed" to the "Move along patrol route" stage.
Watched the video over and over and couldn't figure it out, added loads of print screens and got nowhere...
It turned out that I used a selector instead of a sequence for the patrol state... FML :D
onto Episode 3!
Glad you found the solution at the end, sometimes some patience and trial and error is what it takes
Learned so much from the firs episode of this series. I didn't know anything about behaviour trees and after watching the first episode and then practising on my own I am a lot more comfortable with it. Thank you Ali you are my Unreal Sensei, keep up the excellent work :)
I'm very happy to hear that, you're welcome man, thank you for watching 🙏
This tutorial is everything i pretty much been looking for so far. Wow
Glad it was helpful! Thank you for watching 🙏
Starting this series after completing load and save system which was fantastic. You teaching style is amazing - problem and solution based which i found very helpful in learning process. Just leaving this comment to encourage you to produce more videos in more series especially in multiplayer system login using facebook/google, messenger style chat using dedicated server , and save and load in multiplayer system. Keep up the good work man . Cheers 🎉
Hey, thank you so much for your kind words and suggestions! I really appreciate the support and I'll definitely keep your ideas in mind for future videos. Cheers! 🎉
Im a complete noob and managed to follow this great (yet complexed) tutorial.. I kept leaving comments asking for help but then would follow the logic from what I asked and debug.. Then comment again with a new problem and delete as it changed aha. This is my final comment to say thank you.. Most my issues were to do with leaving a box unchecked or not connecting a pin for example I hadnt connected WeildSword to execute Bind event in the BTT_weildSword and in Sheathe sword so the BT wasn't finishing the task and getting stuck haha.. Having the comments to read through definitely helped me to fill in gaps on parts I had missed or you had done outside of the edit. Thanks for another great tutorial. Took me about 4 hrs as a noob to troubleshoot my mistakes :)
Hey, thanks for sharing your journey with the tutorial! It's really great to see how you were able to troubleshoot and solve the issues on your own. Your perseverance definitely paid off. Glad the comments were helpful, and I'm happy you found the tutorial useful. Keep up the great work!
Amazing tutorials! Learning a lot in here. You just got yourself a new patreon! Can't wait to continue the rest of the tutorials! Keep up the good work!
Thank you so much Twidie 💖 really glad that you are finding my content helpful, and i'm really grateful that you joined my Patreon. I appreciate you 🙏😇
Best Unreal AI content I have seen. Amazing work!
Thank you ❤️ really glad you found it useful
Amazing tutorials! I've been looking for a detailed tutorial on advanced AI like this for months. Thank you so much :)
You're very welcome! Thank you for watching and I hope you enjoy the rest 😊🙏
I like that the way you design these, you are using best practices for how you would set it up for an actual game. Most tutorials just focus on getting it functioning superficially for the purpose of the video.
Thank you for your comment! I really appreciate it. My goal is always to make sure the tutorials I create are not only functional but also designed with a real-world game development approach in mind. I'm glad you noticed that! 🙏
I've only been building BluePrints for about 3 weeks and I was able to follow along easily with a few minor debugs needed for my own errors. Thanks for the great work and I look forward to watching the next one in your video list!
That's great to hear! I'm very happy this was beginner friendly as well. The aim for this series is to be beginner friendly while still teaching intermediate and experts a lot of new things.
thanks so much. I am quite a noob with unreal AI, and I followed along quite easily and had no problems getting to work.
You're most welcome Supa, always happy that I could help ☺️🙏 thank you for watching
These are so good Ali, incredibly clear and explanatory. Keep 'em coming!
Thanks! I'm really happy to hear that you find the videos helpful. I'll definitely keep them coming 😉
Loving my journey through these tutorials... I stopped right before the end and was going to add another decorator for "IsFocused" and got hung up a bit... clicked play and 2 seconds later you went into the focus fix 🤣
Hahaha awesome, glad we were on the same page there
Thank you teacher Ali. Like part 1 your tutorial are very detail moreover your teaching and how you explain are really amazing.
I also consider WieldSword function that didn't show in video as homework.
Even now I cant count the spline point and don't know why it need to -1. The Spline point function are the last thing that I cant understand.
Also it took me nearly 2 month to understand overall how the function operate, That make me realized how I lack of the foundation [Gonna cry in corner]
for example you have 10 spline point in your patrol
spline point index 0 = spline point 1
...
...
...
spline point index 9 = spline point 10
index as defaulf start 0 but your point of number going 1 , 2 , 3...
Thank you so much
Hey there! Thank you so much for your kind words and for sharing your thoughts. I appreciate your dedication to understanding the concepts. Don't worry, taking your time to fully grasp the material is commendable, and it's okay to take a bit longer to fully understand everything. Keep going, you're doing great! 🙏
P.S, checkout the response from @DaviesMurphy, it sheds light on how incrementing the spline point works! Thanks for that Davies
For anyone having issues about being stuck in A state of flip-flop, hence not being able to change states. The problem might be the keyboard key. You can try using the enhanced input system. I first had a problem with the "Tab" button, but when I used it with the enhanced input actions, the problem was solved.
Once again great stuff, completely devoured this tutorial. Love.
Thank you so much for your comment! I'm thrilled to hear that you found the tutorial helpful and enjoyed it. Stay tuned for more great content! 🙏
I'm loving this tutorial series so far great work keep it up
Thank you so much for the positive feedback! I'm glad to hear you're enjoying the tutorials.
Amazing!! As per usual, loving this series so far, thank you!
So happy to hear you're enjoying the series! Thank you for your support 🙏
Your way in teaching is so so so cool....i hope you do a vfx tutorial in ue5 because i am absolutly lost on it ❤❤❤❤❤❤❤❤❤❤❤❤❤❤
Thank you so much for the kind words! I'm glad to hear you enjoy my teaching style. 🙏❤️ Unfortunately I know nothing about making VFX, very far away from my software engineering background
Amazing channel! I'm gonna binge-watch all your videos.
Glad you like it that much. I appreciate your support 🙏
Amazing tutorials! Learning a lot in here. Keep up the good work!
Thank you so much for your kind words! I'm thrilled to hear that you are finding the tutorials helpful. I'll definitely keep them coming. Keep up the great learning!
Hey Ali! Great work with the video. Proberly the best guide in the world ngl.
Thank you for the kind words! I'm really glad you found the video helpful. Your support means a lot!
Awesome, thanks you Ali.这是我见过最好的AI教程
You're welcome 🙏 I'm very happy that you enjoyed it 😊
Man you are the one of my the best explores in this year. Really. Bow for your efforts.
Thank you so much for your kind words! I'm thrilled to hear that my content has been helpful to you. It means a lot! 🙏
Hi Ali , im really excited about the series . Im just bum out that sometimes i dont understand your math, especially the Patrol Index. Im trying my best to understand it, had to crush my head. Hopefully ill knock some sense into my own brain :D
Hey Danny, let me try to explain it simply. The patrol index is just the point on the spline that the enemy is currently on starting at 0 (meaning the first point) so when the enemy moves to the next point we need to add 1 to that index (so then the patrol index is equal to 1 which means the enemy is at the second point in the spline) then we need to check if we reached the end of the spline, by checking if the index is equal to the number of points in the spline (but minus 1 because we started at 0 not at 1) then if we reach the end we just start subtracting 1 from the patrol index instead of adding 1 (this we change the direction to be -1) and do the reverse once we reach point 0 on the spline again. Hope it makes more sense now
@@AliElZoheiry Hey Ali ! Thank you very much clearer now , thank you so much !
@@AliElZoheiry My thought since has been how you figured out this particular logic, it is clean and also very uncommon while looking common
Ur series is amazing and you are very appreciated
Thanks so much for saying that. I appreciate you too 🙏
Great Tutorial, thanks man :)
You're very welcome! I'm glad you found it helpful 🙏
Great video, thats what I was looking for
Hey there! Thank you for watching and commenting! I'm glad the video was able to help you out 🙏
oh yes ,been waiting for this. Thanks
Thank you Cliff! Hope it has what you need, and definitely more to come soon 🙏
Awesome, thanks you Ali. Been waiting for it
Hope you enjoyed it Sajjad and thank you for the support. Part 3 is coming out soon as well
This zooming in and out all the time is making me seasick. The quality of the sound and video is great you dont need to do all the zooming. Awesome tutorial series, learning a lot!
Hey Kasper, thanks for the feedback, I did indeed realize that the zooming was unnecessary and stopped doing that in the later videos of the series. Glad you're finding it useful ☺️🙏
thank you for your efforts brother. my main language is not english. Selam in Turkey. I solved my problem. Press " 1 " not moving npc. Solution in " BT_Enemy_Base " > BTT_SetMovementSpeed > Movement Speed (in right) > Spritting. Not Idle :) I hope it was helpful :)
Hey Ahmet, glad you fixed the issue, well done 💪
Thank you very much sir! Your tutorials are super useful!
You're very welcome! I'm glad you found the tutorials helpful. Thank you for watching and commenting 🙏
OMG, I rewatched the video three times now because some things weren't working correctly and every time I forgot to set the succeed boolean to true in the finish execute note...
Hey there! It happens to the best of us 😉 Glad you figured it out in the end!
This is probably a specific problem I had but an easy fix anyway, my set focus wasn't working so the AI didn't focus on the player before drawing the sword, then I found out that I set the AI rotation settings to Orient Rotation to Movement instead of Used Controller desired Rotation.
Glad to hear you found the solution! It's often the specific details that can make all the difference in debugging. Keep up the good work!
Thank your for this series this will help me alot :) thanks so much
You're very welcome! Thank you for watching :)
These videos have been such a help! Thank you and keep it up! +SUB!
Thank you for the support 🙏 I'm always happy to hear that my tutorials are helping people, I hope to continue helping you :)
So a few things...I'm going to hang with this but you move a little too fast and I think you forgot to show what you did around 41:00 regarding the changes you made to the initial Weird Sword. But so far I'm liking it.
Hey, thanks for your feedback! I indeed didn't show the changes to the WieldSword, because they are exactly the same as the SheathSword event, and I showed the event in the blueprint, so you can pause and see what's happening there if you'd like
Excelent tutorial, you are my favorite now
Thank you! Glad you are enjoying them 😇🙏
In part 1 we built the "BP_Enemy_Base" code (pt 1: 37:00 - 41:07). But it looks like that code got replaced by completely new code, of unknown origin, appearing here in this Part 2 at 8:16.
I've spent a week on this tutorial. I've redone this and part 1 a few times now, and I can't get it working. Here's how mine works:
Press "1" the first time: Enemy just stops patrolling and stares at me.
Press "1" twice: Enemy slides along his patrol zone and continually unsheaths
Press "1" third time: Enemy slides, then finally runs and attacks me.
Press "1" fourth time: Enemy sheaths a few times and returns to his Patrol Path; the sword never disappears.
After tearing out most of my hair, I gave up and downloaded the project zip. When I open that project and play, the Enemy AI faces me, unsheathes, and then runs behind a wall, faces the wrong way, and swings at empty space a few times.
Is there a way to get a project download at the point where the action makes sense at the end-point of this video?
Hey Heavenseek, so the enemy blueprint was not completely replaced with something else, as mentioned at 1:14, I just changed the WieldSword event and behavior tree task to include an animation and an event dispatcher, which I proceed to explain at 38:20. It sounds like your problem is likely with the wield sword event and behavior tree task, make sure that in the WieldSword event you dispatch OnWieldSword and in your task you bind to this event dispatcher and only call Finish Execute then, just like we did for the unwield task at 43:55
@@AliElZoheiry Thanks, I'll search for those and try to fix.....
@@heavenseek Hey man, I found a bug in the engine that might be causing your issue. It happened to me today when I restarted the engine, I found that the Blackboard keys on the "BTT_MoveToIdealRange" in the tree got reset and I had to manually select them again. Meaning that I had to Change the "IdealRadius to be either the AttackRadius or the DefendRadius (depending on whether I'm attacking or strafing) and the AttackTarget set it to AttackTarget as well. Hope this helps
@@AliElZoheiry Thanks very much, I will definitely check that out! 🙏
This is exactly what is happening to me. I followed the directions exactly and have gone back through them several times. I can't see where the discrepancy is. I'll take a look at Ali's suggestions here.
you are really best, im deleted my old ai system in only BP and im trying to use now BT. You are best man and you are best man again and you are best best man. Change your channel name to "BEST MAN"
Thank you so much for your kind words and support! I'm really happy to hear that you found my content helpful as you transition to using behavior trees. I appreciate your enthusiasm and encouragement!
The more better way instead of using a Interface or Cast is to Store Data in ActorCOmponent , this is a great feature using which we not only make Less Coupled things but also modular things
Hey Brock, thank you for the feedback. I indeed use actor components heavily later in the series when I start integrating a damage system and attack system
@@AliElZoheiry I see, that's great then and btw I loved your end result that's why I started watching, if you could make a enemy which can predict player moves like attack, flank
Thanks a thousand times!
You're very welcome! I'm thrilled to hear that you found the content helpful. Thanks for the feedback! 🙏
really great tutorials, thank you very much
You're very welcome! Thank you for watching
love it very helpful
Great to hear that! Thanks for watching and commenting
Great content so far! My AI has been severely lacking. And, these videos are just what I need. I'm wrapping up for the day. I've only had one issue that I cannot seem to figure out.
When I press "1" the first time, everything works great, and I created an UnsheathSword Montage similar as you did, and spawn the sword using a Montage Notify as usual when working with Notifies. But, the Enemy will not turn to face the Player as it unsheathes the sword. It will unsheath, then turn to the Player everytime. I've tried playing around with different things, and I'm not quite sure what is going on.
Other than that everything looks great. I've debugged the AI Behavior Tree, and it looks like it flashes by the BTT_FocusTarget(with AttackTarget as the Attack Target Key) and goes directly to the BTT_UnsheathSword I created under the BTD_IsWieldingSword Decorator. That is all within the first sequence. The numbers on the nodes look correct. I'm not sure why it is skipping the BTT_Focus Target Task though.
EDIT: For now, I'd just added a Wait 0.5 Seconds Node to the middle of the sequence. So it will Focus wait half a second, then unsheath the sword. This gives the AI enough time to turn and face the player, even if directly behind the AI. Using 5.2.1, but don't think much has changed in this regard.
Thank you! Glad you've been enjoying the content
If your AI is taking a long time to turn it could be the rotation speed of the enemy character is slow. If you're not using the default manny character and default settings, make sure to match it to the default manny settings for rotation speed and see if it helps
@AliElZoheiry - Thanks for the tip! I was actually thinking the same thing when I woke up this morning. Oftentimes, I wind up waking up with a proper solution XD
Just got in from some morning endurance cycling. I'm going to get going on my projects in a half hour. And, this will be the first thing I test. Adjusting the turning/rotation speed on the ai mesh.
hey man, did you figure it out? i'm having the exact same issue as you and i don't think it's the rotation speed
@@Dominicn123 - Sorry. I never did figure out the issue with the enemy not facing the player. I just left in the Wait half a second node to the AI Tree which I mentioned above.
At this point I think I'm running off a copy of one of Alizoh's source files I downloaded a while back. I didn't think of looking for the change in the source for that particular issue. When I downloaded the source project, and started working off of that.
Anyone else having issues with "get spline point as world position" at 12:49? I can't get that.
Edit. NVM After UE5 Crashing it had not saved the function in BP_PatrolRoute
These videos are really good :)
Thank you so much for your kind words! I'm really glad to hear that you're enjoying the videos. If you have any specific topics or requests, feel free to let me know. Happy learning!
9:36 Use interface instead of casting
(because the 'increment patrol route' function will apply to all types)
Thank you very much😲
Thank you for the suggestion! I appreciate your input on using interfaces for a more versatile solution.
8:38 (in Scene)
I liked and subbed with all 3 of my accounts, i will be teaching these concept to my friends, thank you
Thank you for the support 🙏 really glad you find it useful
this episode ruined it for me bro, everything was going amazing until this episode, about 3/4ths through the video things began not working right with the enemy, after the whole sheath thing. i followed exactly and went over things three times to ensure no node is incorrectly done, i can see a LOT of others had issues here too, i went on after this video and the other videos are good but this one is the issue one, i know you've defended your edits and actions in the comments but this video seriously desrves a re-do, but go over things completely as you do them, this is the ONE video hurting this entire playlist..
i found this video on reddit, on the UE sub there was about a dozen users who praised the tutorial but warned against part 2 of it, which i ignored because i assumed that i could figure out where they had issues, looks like it got me too, this video is mostly good but had a vital error keeping it from being as polished as your other vids, please re do it bro.
DUDE yes!!!!! I found this on reddit yesterday too but not on that sub, it was from the game devs sub, u/NoFrillaz or whatever shared it but told people to skip the second video because he skipped a lot of steps later on in the vid and it messes up a lot of ppl lol I've been trying to redo things 4 times now and have the exact same issue!!!! it makes me so angry because everything else is SO good!! but darn it
me too I am having trouble with it around that part , my enemy freezes and jitters when supposed to be switching, I agree I wish he can remake it, please Ali
yes bro it was all good until this one, its hard to explain to him about what mine does but reading all the other comments i can see everyone that has issues with this vid, hasthe exact same issue because mine is doing same and it just make me frustrated and i've rechecked everything, please ali it won't take much effort to just redo this one, it will make ur playlist perfectly i've done the following 3 videos after this one and they all are good but the issue on this video has roots that lead and branch out to the after vids.... i've redone this tutorial 3 times now because of this issue, thinking i missed something but no, it's literally all from the sudden addition of nodes later on, even if u mentioned a few changes at the start that doesnt gloss over things, just please redo it in full and show things as you mention them!!! @@BadNewsStudio
i'm having issues too, with the wield sword function part, i know he pinned a comment with a solution but that doesn't quite resolve things in full. i'm hoping for a re-do too haha, i've been stuck on this video for 4 days now
Hey all, just to be clear, there is nothing wrong with the tutorial, you can follow it from start to finish without any problems. The reason I wrote this comment, and the reason you might be having issues, is that event dispatchers, and behaviour trees are a new way of working for most of you, so it can be confusing, but I assure you, the content itself is tried and tested and works perfectly, if you are having issues, feel free to join the Discord server and we have a youtube-help channel there where you can ask your question, provide details, then I or someone else can help you there. Just make sure first to check the existing questions in case you find the solution you're looking for.
Good luck 🤞
This tutorial is great thank you
You're very welcome! Thank you for watching 🙏🙂
Really great stuff here! I've been following along trying to do everything here but with State Trees. Would love to see some future content on handling AI with State Trees. Any chance you've got plans to tackle that topic?
Hey there! Thank you for the kind words and suggestion! I've actually been considering doing a series on AI with State Trees, as it's a popular request. Stay tuned!
@@AliElZoheiry Awesome! Can't wait!
I just have a question, I want to have a box that spawns the monster when the player collides with it, but when I do that and spawn the monster, it doesn’t have a patrol route selected and I don’t know how to make it come with a patrol route already set. Btw I am spawning a new ai and setting it to the enemy when the box collision happens, it does everything except follow the patrol route if that helps.
Hey there! In order to have the monster spawn with a pre-set patrol route, after spawning it, you will have a reference to the spawned character. Then you can just get the PatrolRoute variable from that reference and set it's value to be the reference of the patrolRoute from your level (you will have to get a reference to that patrol route first though, and how to get that reference will depend on how you built your game)
@@AliElZoheiry thank you so much
I followed the steps, but right at the beginning, when the simple test is performed to follow the path, mine stops right at the starting point and doesn't move forward.
Sounds like you're not incrementing the pathIndex correctly
Followed this almost 100% and tried to use the instruction on sheath sword to also create and unsheath and it just gets stuck in the behaviour tree in the first branch of the wield sword line...
Common mistakes are:
- Typo in the montage notify name (either in the montage or the switch statement off of the play montage node)
- You used the wrong type of notify (regular notify instead of montage notify will not work)
- You are not pulling off of the NotifyBegin in your play montage node (before the switch statement)
- You are not binding correctly to the event dispatcher
I'm asking you a question through a translator because I'm Korean, but I don't know if you can translate it accurately.
I have two questions.
1. When the game goes on, the character immediately pulls out the sword, puts it back in, and moves to the spline point. When the game goes on, I want the game to move right away instead of pulling the sword out and putting it back in. How do I fix this?
(Solve: Weild Sword was applied to Beginplay.)
2. I've never solved a non-soft animation with a character movement either, is there a way to go to the line instead of spline point?
(solve: It was solved when I changed 'use controller rotation yaw' to false. However, if you change the function to false, the character will look in the opposite direction when you press the '2' key.
So, in bp_enemybase, 'Set Controller Rotation Yaw' is set to true at the front of FieldSword and false at the front of SheathSword. Also, in bp_enemybase (Self), the default value of 'Set Controller Rotation Yaw' is set to false.
Through this method, the original value works as false, true when the knife is taken out, and false again when the knife is moved.
I don't know if this is the right method, so if you have a problem like me, please try this method and verify it.)
+
If the next motion does not occur after drawing the sword, check 'Call On Field Sword' is connected to On Completed in 'Wield Sword'.
It took me an hour to find the problem..😂
I've found a solution, but I won't erase it to present a solution to someone with a problem like me.
Thank you for your detailed explanation and providing solutions to your own questions! It's great that you've found a method that works for you. Your willingness to share your process to help others is really admirable. Keep up the problem-solving spirit!
My Enemy is Patroling only 1st point of the spline after reach that point Enemy starts idleing and not patroling anymore. I cant understand what am I missing.
Hey, thank you for sharing your issue! It sounds like you are not incrementing the patrol Index correctly. so double check that part of the video
Hello Great Tutorial,
I had a problem where i couldnt change the movement speed for the enemy player. It really took me a long time to find my problem:
at 19:35 he added the "max walk speed",
i mistakenly added "max movement speed".
cheers
Hey, thanks for your comment! I'm glad you enjoyed the tutorial and identified the issue with the movement speed. It's great to hear that you were able to troubleshoot and solve the problem. Happy coding! 🙌
U ARE GOD ! MORE TUTORIAL LIKE THIS !
Thank you Marcus. I hope you enjoy the rest of the series 🙏
@@AliElZoheiry I will check every your tutorial and hope you will continue, u are doin greet job !
I am trying to apply Walk Patroling to my Enemy, but instead of only Walking, some points Enemy is Walking and some points Enemy is Running, Its doing both. Any suggestion.
Hey! If you're points are not evenly spaced out, then the enemy might be accelerating faster and slower depending on your acceleration speed and ground friction and deceleration settings in the character movement component. These all affect how fast your enemy moves
Awesome video! thank you so much again for your incredible capacity to explain things. 10/10 would recommend.
You're very welcome, I'm glad you found it useful, and I appreciate your support 🙏☺️
Thanks for these awesome tutorials! I do have one issue with the Blackboard Decorator that is on the CombatState Selector. With it on, the enemy only runs the PassiveState side of the BT. With it off, the enemy will try to move to AttackTarget, but slingshots around the area never actually reaching the player. I don't know what the issue is, but any insight would be much appreciated.
I'm not really sure I understand the issue, but if it is regarding the decorator not succeeding/failing correctly, then I suggest checking the implementation of the decorator and seeing when it returns false/true.
Otherwise, some common mistakes are:
- Using "Selector" when you mean to use a "Sequence" node
- Setting the wrong input parameter to a decorator or task
I'm sorry, I am having trouble assigning the patrol route spline to my character. I can't find any linkable parameters in my BP_Enemy_Base to the spline and your Video is blocking the view at 8:50 Any clues?
Great tutorial btw!!! Congrats!!!
Hey Erik, so the "PatrolRoute" variable we created in the enemy class should "Instance editable", which means you need to click on the "eye" icon next to the variable name in your blueprint, or make sure the checkbox for "Instance editable" is checked. Then when you select on your enemy in the World. You can search for that variable in the details panel and assign it the value of your patrol route (which also has to be placed in the world first)
THX!!!@@AliElZoheiry
Thank U!!!! U are the best. @@AliElZoheiry
my character seems to be floating and not performing any animation as it moves. How do i fix that?
No idea, it could be anything really. You'll need to debug further to narrow down the problem area
the switching states is not working what could be the problem
Hey, it could be anything really, you need to do a bit more debugging to narrow down the problem area
If you still need help you might just need to check inverse condition on BTD_HasPatrolRoute in the Behavior tree but, that's only if your issue was the passive not working
omg i figured it out all good aha thank god aha aweosme
Nice! Glad you figured it out. Mind sharing with the people here what the problem was and how you fixed it?
thks for this series
You're very welcome 👍
guy be carfull when you name the varible inside the blackboard because it can be valid. do not name the the same name if you have more than one blackboard and also any thing in the engine. For example, when I add blackboard in the selector and press save in behavior tree, it gives me valid and I found out the reason is I have other blackbord key has simmilar name . I just change it
Indeed, also try avoiding reserved names like "Target" or "Actor" etc..
I gonna comment in every video
Thank you so much for your commitment and support! It really means a lot to me. Looking forward to your comments on future videos!
aha it wont move along the path just stays still and it keep trying to find the path sha what am i doing wrong
amazing bro, gracias
De nada, glad you liked it !
I cant get the keyboardevent 1 key to work. i have gone over everything you have done for 1 hour and its all the same? yet i cant do it? any help please
Hey there! I'm sorry to hear you're running into issues. I'd suggest that you check the keybindings in the project settings. You can navigate to Project Settings > Engine > Gameplay Debugger > Input to ensure that the keybindings are correctly set to the desired keys.
Hi Ali, amazing video as usual, always top tier videos, thanks for your knowledge!!
Quick question: i implemented a patrol route for one of my maps, and i spawn allies who will travel through it regularly (moba style). They should go from index 0 to last index, BUT all get assigned the same single patrol route and the patrol index number keeps changing each time i spawn one, so they do not follow 0 -> 1 -> 2 - > ... last index.
Is there any way to have them kind of have their own instance of the same patrol route?
Thanks in advance and please keep up all the amazing work you do !
Hey there! Thank you for your kind words and for reaching out. This tutorial assumes one patrol route per enemy, not multiple enemies following the same route. The main difference is that the PatrolIndex (which we increment when the enemy moves to the next point) is stored on the BP_PatrolRoute itself, therfore multiple enemies can't share it, because when one moves, the index increments and the other enemy will also read that same variable and move to the same point as the first enemy.
To have the patrol route support multiple enemies, you need each enemy to store their own PatrolIndex route, and increment their own copy of that variable
Excelent Video, I have a doubt, in my case my character when he appears on the map makes the animation of drawing his swords, but I want him to not move while he is doing it, so I put a wait at the beginning of the Passive State, it worked but then to advance point o'clock it is also expected, do you know how to make the wait only at the beginning and not repeat itself anymore, thank you.
If your character is doing an action and that action is triggered by a behavior tree task, then you shouldn't Finish the task execution until the action has ended, that's why I added the event dispatcher in the wield and sheath sword functions, to tell the task that the animation is over and you can move to the next node.
This is what you should do as well, because a wait node won't work for all animations since they have different timings
aha i for the life of me cant seem to find current index or set current index or idex only the variable but doesnt look to same and cant plug in two variables aha what do i do
i have a problem where the enemy not chase me after i pressed 1, then, when i disconnect the patrolling sequence, the enemy not moving at all
Hey there, sorry to hear you're having issues. I suggest debugging the behavior tree to see what node is executing when you press "1" (by looking at the tree while the game is running)
@@AliElZoheiry i have found the issue and have fix it. Thank you sir. Love your tutorial and hope I can learn more from you
Was going smooth until the enemy stopped attacking on pressing 1, then i tried to find any errors, couldn't, i thought maybe previous files are causing some error so deleted those, thought that by mistake i deleted all the ai folders so closed unreal without saving and now neither the enemy moves to player neither it focuses and neither it attacks 😅
Btw the tutorials are great 👌
Hey! Sorry to hear about the issue you faced. It seems like quite a hassle. Have you tried checking the NavMesh and the AI's blackboard to ensure all references and tasks are set up properly? Thank you for the kind words about the tutorials though! I'm glad you are finding them helpful. 😅
@@AliElZoheiry yes i have tried checking all references, even i copied each and every step you did but still the problem persists
Hi, I wonder is there any way to make the ai follow a specific patrol route when spawned, like for example an ai spawner when the ai is spawned, how to make that ai follow a specific patrol route, thank you. Btw love your vids!!
Hey there. This is the topic of the video, how to make a specific route and have the AI follow it, not sure if you meant something else
Great videos @AliElzoHeiry one small thing and im not sure if its covered in a later video but the character jitters a bit in animation when it reaches the spline point. like its deciding whether to keep walking at the next spline point. can this be made smoother somehow or is it just the nature of using splines?
You can play around with the character movement settings, things like declaration and acceleration speeds and friction, etc.. these can help you get a smoother effect
In the tasks should you have an is valid off of controlled pawn? In my case I'm going to have a bunch of zombies. COD zombies style. And in my prototype (where I just used blueprints instead of behavior trees) I'd get all kinds of errors when they died unless I put is valid like everywhere lol
Hey there! It depends on how you implement the death logic. If you unpossess the pawn from the controller, then you should stop the logic of the behavior tree anyway, so it doesn't matter if there is an isValid check.
Generally, if you're controlled pawn is ever inValid, then that means you have something else wrong in your implementation, because that case should never occur
45:58 When I press 1, the enemy just runs towards me and uses the Sword_slash montage, but the montage_Sheath_Sword and montage_Unsheath_sword animations don't work, even the BP_sword sword doesn't appear, I checked and followed everyone's comments but still not successful, is there any way, please help me
1. Make sure that you are connecting the skeletal mesh to the montage
2. Make sure there is no typo in the montage notify name
3. Make sure you are using a Montage notify and not a regular notify in your montage asset
4. Make sure you pulling the switch off of "Notify Begin" pin in your play montage node
lol wont go along the path i tried everything ste by step but just stands there aha i need help aha
Just out of curiosity, I'm just trying to make a simple Souls-Like Boss fight, I have the basics for the AI BT you've shown in the 1st episode, I was wondering what videos in order I could watch to get to the final 3 videos without missing anything important.
For reference the character I'm following with is the boss I just don't need him patrolling/ hiding to get health if that makes sense?
Love the series though and will definitely be coming back to learn more soon! 😄
Hey Darryd, not sure I can tell you which videos to skip because the entire series is built sequentially, so there might be a slight change I make in one video that is used in a later one.
What you can do though is check the "chapters" that are timestamped in each video, and they will give you an idea on the contents of that video, then decide whether to skip it or not
These videos are great! I find myself stumbling through UE5, how did you get to the point where you could build behavior trees, tasks and functions on the fly?
Thank you! I'm glad you're finding the videos helpful. Building behavior trees, tasks, and functions became easier with practice and experimentation. I recommend trying out small projects to gradually build your skills and confidence in UE5. Keep experimenting and learning - you'll get there!
I cannot get the NPC to move to spline points. I'm not sure where the breakdown is because the AI debug says it's the current task, but the NPC doesn't move. I went back through the tutorial twice and I don't know what I'm missing. The only thing that I've changed from the original tutorial is I promoted the Acceptance Distance to an exposed variable on the AI Move To inside the BTT_MoveAlongPatrolPath task so I could modify it directly from the main behavior tree, and replaced the Scene Root Actor with a custom sprite billboard that is easier to find among all my world objects - I'm still able to assign the BP_PatrolSpline actor to the NPC, so the reference isn't broken as far as I can tell, and it's not abandoning the task when I put it on a selector to choose between patrolling and chasing, so I have no idea why it won't move. I haven't gone beyond timestamp 15:25 because AFAIK the implementation is broken somehow and it shouldn't be an issue with UE 5.3 - does anyone have any helpful advice for what I could be missing? Any help is appreciated.
Hey, I can't really tell what your bug is just from this description, so I suggest that you add breakpoints or print statements in the patrolPath to see if it's printing the values you expect, that will help narrow down the problem.
If you still can't figure it out, feel free to join the discord server and ask your question in the help channel there with more details and screenshots (Link in the description)