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!
the crazy part is always after all that MINUS,PLUS EQUAL SET THIS GET THAT.. when you finaly realize that everything makes absolute sense. Thanks for your help Sensei
My favorite Unreal tutorial series! I love how you make everything in the "best" way possible - I don't always get why you're doing what you are doing, but after thinking about it for a while, and watching your videos on components and event dispatchers, I love that you show the most scalable way to design a game. I am now using best practices without even thinking about it, all thanks to you!
Hey! Thank you so much for your kind words. I’m really glad to hear that you’re finding my tutorials helpful and that you're picking up on best practices. Your support means a lot! 🙏
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.
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
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.
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
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 :)
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!
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! 🎉
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.
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 🙏😇
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 ;)
I love this series, I have watched it several times when creating an Ai. I would absolutely love a Zombie Ai tutorial. Opening doors, stumbling over each other, and I have not seen a "Zombie Grab" paired animation tutorial on TH-cam. Anywho. Thank you!
Hey! I'm really glad to hear you've enjoyed the series and found it helpful 🙏 I appreciate your suggestions for a Zombie AI tutorial - that sounds like a lot of fun! I'll definitely keep that in mind for future content. Thank you for your feedback!
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!
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 🤣
This is a really informative course. Thanks for the work you put into teaching all of us. I got hung up for a while because I was setting the index instead of the direction as 1 or -1 lol. Took me a while but I eventually figured out the issue.
Hey! I'm glad you found the course informative! 😄 No worries about getting hung up; it happens to the best of us. Thanks for sharing your experience, and I'm happy you figured it out! 🙏
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
Awesome content, it is clear and very understandable for me. I can tell you know very well what your are doing and how to use Unreal Engine. Thanks for sharing your outstanding knowledge!
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! 🙏
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
Hey Bro, I Am Very Thankful To You For This Series, I Can Find Proper Tutorial For Enemy Advanced AI but Then I Found Your Channel Complete Series But Facing a Problem with The Wielding Sword Animation.I also Have a problem I Applied The Blueprint Without Knowing What IT Does , But You explained it really Well. Love From Pakistan ❣
Hey! I'm really glad to hear that you found the series helpful. If you're having trouble with the wielding sword animation, feel free to describe the issue in more detail, and I'll do my best to assist you. Thank you for your support, and love back to Pakistan! 🙏❤️
@@AliElZoheiry i copied your steps but you have already created the wield sword animation but i copied you and did the same with the sheath sword my character not doing anything except only running and when I removed the wield sword animation and left only the sheath aniamtion my character keep repeating the sheath animation
For anyone having issues with the enemy not unsheathing the sword correctly, or sliding all over the place, the fix for me was in BP_Enemy_Base. I had "Call on Wield Sword" connected to the top right hand pin of the associated Play Montage, when it should have been connected to the "On Completed" pin. Same issue with the "Call on Sheath Sword". I also had an issue with the enemy walking the Patrol Route. My issue was that some of the spline points were below ground level. Check each spline point in the Patrol Route and ensure the Z axis value for Location (the blue one I think) under the "Selected Points" section of the Details panel is set to "0".
Thank you for sharing this fix! Those details about connecting the pins and checking the spline points are definitely helpful for others who might encounter the same issues. 🙏
I have a similar Issue of sliding while unsheathing the sword, the animation plays well but the enemy slides towards the player. I made sure the pins were "on completed". when seeing the behaviour tree it appears the enemy goes directly into "move to target" while the animation runs. I tried using the function SetMovement to make speed "idle" and "sprinting" before and after playing the montage, but it doesnt work, it appears that the speed I set gets overwritten. All the rest of enemy behaviour seems fine
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!
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)
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.
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!
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 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
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!
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.
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
Keep in mind if you're not using animations for sheathing and unsheathing the sword and the AI don't actually goes back to patrolling at 45min, that's most likely due to the nodes firing off to fast in the SheathSword event, this could be solved by putting a delay right before the "Call On Sheath Sword" Event dispatcher giving it a little bit of time to catch up.
Thank you insights! If you are not using animations, then I would definitely suggest a different method other than event dispatchers, because the main reason the dispatcher is there, is so that the behavior tree task can wait until the animation ends before finishing the task.
Hey, glad you like the series! I recommend checking the description and chapters of each video to know whether you want to skip it or not. As I write detailed chapters and what you'll learn in each video. Hope it helps 🙏
For the WieldSword and SheathSword events, after adding "Bind Event to" nodes and custom "Finish" events, the AI would stop working on the first button click on each action (once for the wield, and once for the sheath), but work fine afterwards. Reintroducing a tiny delay on both the SheathSword and WieldSword events in BP_Enemy_Base solved it for now. I am not using any play montage for these two actions at this time.
Hey, adding a delay to solve it usually means that you have an issue with the flow of execution, so either you are not binding to the event correctly, or you are binding at the wrong time (e.g binding after the event has fired, which won't do anything) or you are not firing the event at the correct time, so check those things
@@AliElZoheiry Ah, I see. Looks like putting the Bind Event to X node before calling the events in the respective BTT seems to work without the delay nodes in the BP_Enemy_Base 😁
UE 5.5.1 dont work with WieldSword functionality and Patrol Route only one work I try to inverse they work but dont change the Behavior Tree settings only thing what is working after press multiple time 1 or any key you set they show the weapon and contiinue to patrol dont attack stay in patrol zone
Hey! This is not related to engine version, it sounds like there is a bug in your logic causing the behavior to fail the first time and then work subsequently. So I suggest opening the tree while the game is running and seeing the flow of execution and adding print statements or breakpoints in your flow to see where it goes wrong
Hey! if you don't see the increment function, then you are probably trying to call it on the wrong actor reference, make sure you have the right reference to the BP_PatrolRoute to call the function on it
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 :)
Hello, I am a student studying your tutorial in Korea. I have a question. To give this behavior to multiple actors, do I need to create a tree for each entity?
Hey! Thank you for reaching out. You don't need to create a separate behavior tree for each actor. You can share the same behavior tree among multiple actors, as long as they inherit or implement the same class. It keeps things organized and efficient! Hope this helps 🙏
I'm finally up to speed on this video, got everything working, the only issue I am having is with the enemy attack when I am really close. The way it starts is on attack, They focus and run at me to attack, but then when I get really close, the enemy stops turning, and instead, will start attacking in the direction they were looking at until I separate myself with enough distance for them to turn towards me. I tried messing with the "Move To Target acceptable radius "which did help a little, but even at "0" they still wont turn when I am really close. Does this get covered later on, or maybe there is someway to make sure the enemy will always rotate towards me before attacking? This isn't a huge deal, I can always fix this later on for my project. Anyways, thanks for the vid! Cheers! 🙌
Hey there! Thanks for your feedback, I'm glad you're finding the video helpful. It seems like the issue you're facing might be related to the way the enemy rotation is being handled. I'd suggest checking that in the base enemy pawns character movement you have "Use controller desired rotation" set to true. Hope that helps and best of luck with your project! Cheers! 🙌
@@AliElZoheiry Thanks for the response, yeah I have "use controller desired rotation" set to true, the enemy just didn't want to turn when I was really close to them for some reason so I did mess around with some settings to see if I could fix it. But yeah, everything seems to be working now because in part 4 video the enemy is given a "strafe" in the BT so now they strafe around me while in attack which is perfect. I know you get a lot of comments on this series but I really do appreciate all the help! 🙏
Your videos are very good, however, something caught my attention, when you did the "cast to" of the character's Blueprint in the attack BTT, you said that it is not a good practice to do this, what is the good practice in this case? For example, I am trying to use Interface in the character's Blueprint to execute the attack but I can't find a way to execute the "event dispatcher" using interface to end the attack action after the animation montage are axecuted, I got stuck on this, my intention is to avoid casting the character's Blueprint.
Hey! I'm glad you're enjoying the videos 🙏 Regarding your question, indeed, I say it's not best practice to cast here, because then we limit the use of this task to the class we are casting to, because if any other class tries to use this task, the cast will fail and they can't use it. Therefore, it is indeed always better to call interface functions that any class can implement, and if they don't, then nothing happens, but they still have the option to implement it. With event dispatchers, it is unfortunate that those can't be part of an interface, so you will always have to cast to a specific actor to bind to their dispatched event, unless... you create an "Event Manager", which is a central class (e.g the GameState or GameInstance) that handle all of your event dispatchers, so instead of having the enemy dispatch an event saying they are done attacking, you have the enemy call a function on the gameinstance and the game instance dispatches that event with a reference to the enemy that is calling it. This is a lot more complicated though and you will have to handle the case where 1 enemy dispatches and event, but another enemy listens to it and has to ignore it, etc.. If you want to learn more about event managers, I have a video on it as well th-cam.com/video/y4fE2JdFdvY/w-d-xo.html
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)
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
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.
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!
The function "Get Spline point as world position" is a custom function I created at 07:00 this is not an engine function, so I think you're confusing it with something else
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
I have a problem with patrol system , chasing and attacking is perfect but patrol is not working properly sometimes enemy stops suddenly and the patrol happen only once he does not repeat it by getting back to same starting point . I assume that the problem is with my landscape, as I am using a desert landscape it has many up's and down's i think this might causing problem but again sometimes character travels the end point even spline is under landscape but again not returns he just wait there.
Hey! That sounds like a tricky issue. It could definitely be related to the landscape’s elevation. Make sure to check both your spline's setup and the logic for returning to the starting point in your patrol behavior. If the spline is under the landscape, it may not trigger properly. I recommend adding some debug prints to see where the issue comes from. Hope that helps! 🙏
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!
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
Hey! This is the custom function we created at 07:00 in the patrolRoute, so make sure you spell it the same as you named it there, and also make sure you are referencing the correct actors before you search for the function name
Im pretty new to this whole UE world but at 32:32 where you cast to the AIController couldn’t you just add the AIC as a Component in the Components Menu to gain access to all its variables and stuff?
Hey! Indeed that is of course possible, but this is just part 2 of the series, things get a lot more complex as it goes on. This is only done to ease people into the topic
Thank you so much for the series this is amazing work! I am having a problem when I follow your steps at 30:00. I noticed that when I made the switching between states for my enemy his movement speed stays at sprinting while following the route even if my speed is set to walking. However, under patrol sequence if i swap the MoveAlongPatrolRoute with SetMovementSpeed then the enemy walks normally and attacks while sprinting as desired. But if I keep it as you showed somehow it doesn't walk while on patrol he only sprints between points. I am stuck for days and I cannot seem to find the issue and I literally follow the same steps as you took. Any ideas as to what may have gone wrong?
Hey! I'm not really sure I understand the problem, but if the movement behavior of your character is different than mine, then it is likely the default settings of the charactermovement component that comes with the BP_ThirdPersonCharacter in this template. If you are not using the same character, then it's likely the settings of the character movement will be different
@@AliElZoheiry Sorry that was indeed confusing. 😅 Basically when my character is patrolling, the animation of the character is like it is running but on a walking speed. From what I understand the animation is constantly on running animation no matter the speed of the enemy. However if i set my enemy in the world without using him with the behaviour tree and set him to just walk towards me on a fixed speed, the animation will work between running and walking. But not when the enemy is possessed under the behaviour tree. I hope that makes more sense
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!
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 🤞
I was stuck for many hours (using 5.4) that the enemy did not unsheath the sword and just stood still. The fix was to change the play rate in the first Play montage to -1. Because the animation is set to -1.
In the behavior tree tasks that you create you are casting to the enemy base class. Do you think it would be more efficient to either update the BBkey through the enemy blueprint by using "get ai controller>get blackboard>set blackboard value as..." OR would it be better in the behavior tree to cast only once and store the enemy reference instead of casting every created task?
Once we start adding the enemy AI interface, I won't be casting as often since I'll be calling interface functions, but in general, casting isn't a performance heavy operation, so you can cast on each tick, hundreds of times and it won't be a performance issue unless it's thousands of times per tick
Hello. In the video at 32:40, you add "Cast to AIC_Enemy_Base". When I press 1, it stops right at this Node. The cast simply fails. What could be causing this? Thank you
@AliElZoheiry Quick question, at 44:50, you insert another selector here to match the attack state but isn't our "Passive State" already a selector? Can't you just add the BTT_SheathSword, with its decorator directly into the PassiveState? It will run the first time then be skipped the 2nd as the selector moves from left to right? Is there a reason for that extra selector? Just trying to wrap my head around this, absolutely phenomenal tutorial series my friend. Are you an official Epic tutor? Might be something worth looking into as you clearly have a pretty deep knowledge of the engine.
Hey! not sure exactly what you are referring to. But the idea is that the first time the decorator will cause the branch to succeed, thus sheathing the sword. The 2nd time, the decorator will fail because the sword is already sheathed so that will trigger the branch on the right. Hope that makes sense. Regarding your other question, unfortunately no, I am not an official epic tutor, they kinda want me to change my linkedIn to be all about tutoring, and that seems a bit reductive for me
@@AliElZoheiry My timecode was a bit off paused at 45:27 shows it better, you have Passive state (Selector) into another selector, into another selector. The decorator on the top on is just a state check for passive. I'm pretty sure those extra 2 selectors are redundant? They can be removed so it's just: - Selector "Passive state" - Sheath sword as 0 - Patrol sequence as 1 - Wait as 2 Fair enough with the epic tutoring, that's a bizarre requirement.. I only asked because the production quality of these tutorials is exceptional so fantastic work mate, thanks!
@@Arctan95 Ahh i see what you mean! You are absolutely correct, that 2nd selector doesn't add anything, it can be removed as well since one selector with a single selector underneath it will always be picked
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.
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 🙏😊
the crazy part is always after all that MINUS,PLUS EQUAL SET THIS GET THAT.. when you finaly realize that everything makes absolute sense. Thanks for your help Sensei
You're very welcome! I'm glad everything is starting to make sense for you. Thank you for watching and commenting 🙏
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 🙏❤️
My favorite Unreal tutorial series! I love how you make everything in the "best" way possible - I don't always get why you're doing what you are doing, but after thinking about it for a while, and watching your videos on components and event dispatchers, I love that you show the most scalable way to design a game. I am now using best practices without even thinking about it, all thanks to you!
Hey! Thank you so much for your kind words. I’m really glad to hear that you’re finding my tutorials helpful and that you're picking up on best practices. Your support means a lot! 🙏
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 ☺️🙏
This series I by far the best taught content I've watched on Unreal here on TH-cam
Thank you so much for your kind words! I'm glad you found the series helpful and well-taught. Appreciate your 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.
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
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.
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!
Essa série, é de longe o melhor conteúdo de turoriais da Unreal aqui no TH-cam. Parabéns!
Obrigado pelo seu comentário! Fico muito feliz em saber que você está gostando da série 🙏
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 🙏
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!
مش شايف مصريين كتير يا بشمهندس علي بس بجد أنت فخر لينا أنت من الأخر جاااااامد شكرا ليك جدااا❤❤❤❤
شكرًا جدًا لك! سعيد جدًا إنك استفدت من الفيديوهات 🙏
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! 🎉
This tutorial is everything i pretty much been looking for so far. Wow
Glad it was helpful! Thank you for watching 🙏
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 😊🙏
as a unity refugee i am absolutely loving this series so far
Hey! I'm glad to hear you're enjoying the series! Welcome aboard 🙏
Best Unreal AI content I have seen. Amazing work!
Thank you ❤️ really glad you found it useful
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.
EZRA YOU ARE THE BEST UE5 TEACHER!
Thank you so much for your kind words! I appreciate your support 🙏 You're the 4th person to think I look like Ezra btw. Love it
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 🙏😇
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 ;)
I love this series, I have watched it several times when creating an Ai. I would absolutely love a Zombie Ai tutorial. Opening doors, stumbling over each other, and I have not seen a "Zombie Grab" paired animation tutorial on TH-cam.
Anywho. Thank you!
Hey! I'm really glad to hear you've enjoyed the series and found it helpful 🙏 I appreciate your suggestions for a Zombie AI tutorial - that sounds like a lot of fun! I'll definitely keep that in mind for future content. Thank you for your feedback!
@@AliElZoheiry Plus one from me!
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
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
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
This is a really informative course. Thanks for the work you put into teaching all of us. I got hung up for a while because I was setting the index instead of the direction as 1 or -1 lol. Took me a while but I eventually figured out the issue.
Hey! I'm glad you found the course informative! 😄 No worries about getting hung up; it happens to the best of us. Thanks for sharing your experience, and I'm happy you figured it out! 🙏
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 😉
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
Awesome content, it is clear and very understandable for me. I can tell you know very well what your are doing and how to use Unreal Engine. Thanks for sharing your outstanding knowledge!
Thank you so much for your kind words! I'm glad to hear you find the content clear and understandable. I appreciate your support 🙏
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! 🙏
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
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.
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! 🙏
Hey Bro,
I Am Very Thankful To You For This Series, I Can Find Proper Tutorial For Enemy Advanced AI but Then I Found Your Channel Complete Series But Facing a Problem with The Wielding Sword Animation.I also Have a problem I Applied The Blueprint Without Knowing What IT Does , But You explained it really Well. Love From Pakistan ❣
Hey! I'm really glad to hear that you found the series helpful. If you're having trouble with the wielding sword animation, feel free to describe the issue in more detail, and I'll do my best to assist you. Thank you for your support, and love back to Pakistan! 🙏❤️
@@AliElZoheiry i copied your steps but you have already created the wield sword animation but i copied you and did the same with the sheath sword my character not doing anything except only running and when I removed the wield sword animation and left only the sheath aniamtion my character keep repeating the sheath animation
Amazing channel! I'm gonna binge-watch all your videos.
Glad you like it that much. I appreciate your support 🙏
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 🙏
For anyone having issues with the enemy not unsheathing the sword correctly, or sliding all over the place, the fix for me was in BP_Enemy_Base. I had "Call on Wield Sword" connected to the top right hand pin of the associated Play Montage, when it should have been connected to the "On Completed" pin. Same issue with the "Call on Sheath Sword".
I also had an issue with the enemy walking the Patrol Route. My issue was that some of the spline points were below ground level. Check each spline point in the Patrol Route and ensure the Z axis value for Location (the blue one I think) under the "Selected Points" section of the Details panel is set to "0".
Thank you for sharing this fix! Those details about connecting the pins and checking the spline points are definitely helpful for others who might encounter the same issues. 🙏
I have a similar Issue of sliding while unsheathing the sword, the animation plays well but the enemy slides towards the player. I made sure the pins were "on completed". when seeing the behaviour tree it appears the enemy goes directly into "move to target" while the animation runs. I tried using the function SetMovement to make speed "idle" and "sprinting" before and after playing the montage, but it doesnt work, it appears that the speed I set gets overwritten. All the rest of enemy behaviour seems fine
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!
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!
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
@@AliElZoheiry you are the best!
Your tutorials are brilliant!!
Thank you so much for your kind words! I'm glad you find them helpful 🙏
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! 🙏
Ur series is amazing and you are very appreciated
Thanks so much for saying that. I appreciate you too 🙏
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.
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 🙏
Awesome, thanks you Ali.这是我见过最好的AI教程
You're welcome 🙏 I'm very happy that you enjoyed it 😊
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
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!
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 🙏
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 ☺️🙏
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
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!
Excelent tutorial, you are my favorite now
Thank you! Glad you are enjoying them 😇🙏
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.
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
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
If like you are my lecturer there is no way I will fail your course
Thank you so much for your kind words! I'm really glad to hear that you find the content helpful 🙏
oh yes ,been waiting for this. Thanks
Thank you Cliff! Hope it has what you need, and definitely more to come soon 🙏
Keep in mind if you're not using animations for sheathing and unsheathing the sword and the AI don't actually goes back to patrolling at 45min, that's most likely due to the nodes firing off to fast in the SheathSword event, this could be solved by putting a delay right before the "Call On Sheath Sword" Event dispatcher giving it a little bit of time to catch up.
Thank you insights! If you are not using animations, then I would definitely suggest a different method other than event dispatchers, because the main reason the dispatcher is there, is so that the behavior tree task can wait until the animation ends before finishing the task.
This series is excellent, but are there and lessons I could skip without getting lost if my main goal was a (smart) shooter AI?
Hey, glad you like the series! I recommend checking the description and chapters of each video to know whether you want to skip it or not. As I write detailed chapters and what you'll learn in each video. Hope it helps 🙏
Thank your for this series this will help me alot :) thanks so much
You're very welcome! Thank you for watching :)
For the WieldSword and SheathSword events, after adding "Bind Event to" nodes and custom "Finish" events, the AI would stop working on the first button click on each action (once for the wield, and once for the sheath), but work fine afterwards. Reintroducing a tiny delay on both the SheathSword and WieldSword events in BP_Enemy_Base solved it for now. I am not using any play montage for these two actions at this time.
Hey, adding a delay to solve it usually means that you have an issue with the flow of execution, so either you are not binding to the event correctly, or you are binding at the wrong time (e.g binding after the event has fired, which won't do anything) or you are not firing the event at the correct time, so check those things
@@AliElZoheiry Ah, I see. Looks like putting the Bind Event to X node before calling the events in the respective BTT seems to work without the delay nodes in the BP_Enemy_Base 😁
UE 5.5.1 dont work with WieldSword functionality and Patrol Route only one work I try to inverse they work but dont change the Behavior Tree settings only thing what is working after press multiple time 1 or any key you set they show the weapon and contiinue to patrol dont attack stay in patrol zone
Hey! This is not related to engine version, it sounds like there is a bug in your logic causing the behavior to fail the first time and then work subsequently. So I suggest opening the tree while the game is running and seeing the flow of execution and adding print statements or breakpoints in your flow to see where it goes wrong
Hey Ali, I'm having a problem with patrolroute, can't increment in the task. Tried everything it just doesn't give me the node increment!
Hey! if you don't see the increment function, then you are probably trying to call it on the wrong actor reference, make sure you have the right reference to the BP_PatrolRoute to call the function on it
@@AliElZoheiry Thanks man, solved it!
@@Amine3DArt-vp3qg how
Great Tutorial, thanks man :)
You're very welcome! I'm glad you found it helpful 🙏
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 💪
Hello, I am a student studying your tutorial in Korea. I have a question. To give this behavior to multiple actors, do I need to create a tree for each entity?
Hey! Thank you for reaching out. You don't need to create a separate behavior tree for each actor. You can share the same behavior tree among multiple actors, as long as they inherit or implement the same class. It keeps things organized and efficient! Hope this helps 🙏
really great tutorials, thank you very much
You're very welcome! Thank you for watching
I'm finally up to speed on this video, got everything working, the only issue I am having is with the enemy attack when I am really close. The way it starts is on attack, They focus and run at me to attack, but then when I get really close, the enemy stops turning, and instead, will start attacking in the direction they were looking at until I separate myself with enough distance for them to turn towards me. I tried messing with the "Move To Target acceptable radius "which did help a little, but even at "0" they still wont turn when I am really close. Does this get covered later on, or maybe there is someway to make sure the enemy will always rotate towards me before attacking?
This isn't a huge deal, I can always fix this later on for my project. Anyways, thanks for the vid! Cheers! 🙌
Hey there! Thanks for your feedback, I'm glad you're finding the video helpful. It seems like the issue you're facing might be related to the way the enemy rotation is being handled. I'd suggest checking that in the base enemy pawns character movement you have "Use controller desired rotation" set to true. Hope that helps and best of luck with your project! Cheers! 🙌
@@AliElZoheiry Thanks for the response, yeah I have "use controller desired rotation" set to true, the enemy just didn't want to turn when I was really close to them for some reason so I did mess around with some settings to see if I could fix it. But yeah, everything seems to be working now because in part 4 video the enemy is given a "strafe" in the BT so now they strafe around me while in attack which is perfect.
I know you get a lot of comments on this series but I really do appreciate all the help! 🙏
My pleasure @@TrackstarOPhappy to help where I can 🙏
Your videos are very good, however, something caught my attention, when you did the "cast to" of the character's Blueprint in the attack BTT, you said that it is not a good practice to do this, what is the good practice in this case?
For example, I am trying to use Interface in the character's Blueprint to execute the attack but I can't find a way to execute the "event dispatcher" using interface to end the attack action after the animation montage are axecuted, I got stuck on this, my intention is to avoid casting the character's Blueprint.
Hey! I'm glad you're enjoying the videos 🙏 Regarding your question, indeed, I say it's not best practice to cast here, because then we limit the use of this task to the class we are casting to, because if any other class tries to use this task, the cast will fail and they can't use it.
Therefore, it is indeed always better to call interface functions that any class can implement, and if they don't, then nothing happens, but they still have the option to implement it.
With event dispatchers, it is unfortunate that those can't be part of an interface, so you will always have to cast to a specific actor to bind to their dispatched event, unless... you create an "Event Manager", which is a central class (e.g the GameState or GameInstance) that handle all of your event dispatchers, so instead of having the enemy dispatch an event saying they are done attacking, you have the enemy call a function on the gameinstance and the game instance dispatches that event with a reference to the enemy that is calling it.
This is a lot more complicated though and you will have to handle the case where 1 enemy dispatches and event, but another enemy listens to it and has to ignore it, etc..
If you want to learn more about event managers, I have a video on it as well th-cam.com/video/y4fE2JdFdvY/w-d-xo.html
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
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
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.
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!
12:56 "Get spline world position" is now named "Get spline point location"
The function "Get Spline point as world position" is a custom function I created at 07:00 this is not an engine function, so I think you're confusing it with something else
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
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 :)
I have a problem with patrol system , chasing and attacking is perfect but patrol is not working properly sometimes enemy stops suddenly and the patrol happen only once he does not repeat it by getting back to same starting point . I assume that the problem is with my landscape, as I am using a desert landscape it has many up's and down's i think this might causing problem but again sometimes character travels the end point even spline is under landscape but again not returns he just wait there.
Hey! That sounds like a tricky issue. It could definitely be related to the landscape’s elevation. Make sure to check both your spline's setup and the logic for returning to the starting point in your patrol behavior. If the spline is under the landscape, it may not trigger properly. I recommend adding some debug prints to see where the issue comes from. Hope that helps! 🙏
This tutorial is great thank you
You're very welcome! Thank you for watching 🙏🙂
Another great tutorial.
You're welcome! I'm glad you enjoyed it! Thanks for watching and commenting 🙏
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)
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
ur screen is very blurry whats the thing u search for at 5:02 to get current index ?
add +
12:54 i cant see get point as world posittion. how can i fix this? please help me
Hey! This is the custom function we created at 07:00 in the patrolRoute, so make sure you spell it the same as you named it there, and also make sure you are referencing the correct actors before you search for the function name
Im pretty new to this whole UE world but at 32:32 where you cast to the AIController couldn’t you just add the AIC as a Component in the Components Menu to gain access to all its variables and stuff?
Hey! Indeed that is of course possible, but this is just part 2 of the series, things get a lot more complex as it goes on. This is only done to ease people into the topic
Thank you so much for the series this is amazing work! I am having a problem when I follow your steps at 30:00. I noticed that when I made the switching between states for my enemy his movement speed stays at sprinting while following the route even if my speed is set to walking. However, under patrol sequence if i swap the MoveAlongPatrolRoute with SetMovementSpeed then the enemy walks normally and attacks while sprinting as desired. But if I keep it as you showed somehow it doesn't walk while on patrol he only sprints between points. I am stuck for days and I cannot seem to find the issue and I literally follow the same steps as you took. Any ideas as to what may have gone wrong?
Hey! I'm not really sure I understand the problem, but if the movement behavior of your character is different than mine, then it is likely the default settings of the charactermovement component that comes with the BP_ThirdPersonCharacter in this template. If you are not using the same character, then it's likely the settings of the character movement will be different
@@AliElZoheiry Sorry that was indeed confusing. 😅 Basically when my character is patrolling, the animation of the character is like it is running but on a walking speed. From what I understand the animation is constantly on running animation no matter the speed of the enemy. However if i set my enemy in the world without using him with the behaviour tree and set him to just walk towards me on a fixed speed, the animation will work between running and walking. But not when the enemy is possessed under the behaviour tree. I hope that makes more sense
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!
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 🤞
I was stuck for many hours (using 5.4) that the enemy did not unsheath the sword and just stood still. The fix was to change the play rate in the first Play montage to -1. Because the animation is set to -1.
Glad to hear you found the fix! It's always the small details that can make a big difference. Thanks for sharing that solution! 🙏
In the behavior tree tasks that you create you are casting to the enemy base class. Do you think it would be more efficient to either update the BBkey through the enemy blueprint by using "get ai controller>get blackboard>set blackboard value as..." OR would it be better in the behavior tree to cast only once and store the enemy reference instead of casting every created task?
Once we start adding the enemy AI interface, I won't be casting as often since I'll be calling interface functions, but in general, casting isn't a performance heavy operation, so you can cast on each tick, hundreds of times and it won't be a performance issue unless it's thousands of times per tick
Hello. In the video at 32:40, you add "Cast to AIC_Enemy_Base". When I press 1, it stops right at this Node. The cast simply fails. What could be causing this? Thank you
The only reasons for the cast to fail is either you are casting to the wrong class, or you didn't set the AI controller to the pawn
@AliElZoheiry Quick question, at 44:50, you insert another selector here to match the attack state but isn't our "Passive State" already a selector? Can't you just add the BTT_SheathSword, with its decorator directly into the PassiveState? It will run the first time then be skipped the 2nd as the selector moves from left to right? Is there a reason for that extra selector? Just trying to wrap my head around this, absolutely phenomenal tutorial series my friend.
Are you an official Epic tutor? Might be something worth looking into as you clearly have a pretty deep knowledge of the engine.
Hey! not sure exactly what you are referring to. But the idea is that the first time the decorator will cause the branch to succeed, thus sheathing the sword. The 2nd time, the decorator will fail because the sword is already sheathed so that will trigger the branch on the right. Hope that makes sense.
Regarding your other question, unfortunately no, I am not an official epic tutor, they kinda want me to change my linkedIn to be all about tutoring, and that seems a bit reductive for me
@@AliElZoheiry My timecode was a bit off paused at 45:27 shows it better, you have Passive state (Selector) into another selector, into another selector. The decorator on the top on is just a state check for passive.
I'm pretty sure those extra 2 selectors are redundant? They can be removed so it's just:
- Selector "Passive state"
- Sheath sword as 0
- Patrol sequence as 1
- Wait as 2
Fair enough with the epic tutoring, that's a bizarre requirement.. I only asked because the production quality of these tutorials is exceptional so fantastic work mate, thanks!
@@Arctan95 Ahh i see what you mean! You are absolutely correct, that 2nd selector doesn't add anything, it can be removed as well since one selector with a single selector underneath it will always be picked
Thanks a thousand times!
You're very welcome! I'm thrilled to hear that you found the content helpful. Thanks for the feedback! 🙏
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!
I have User Controller desired Rotation but its still not focusing..
I solved it by letting it rotate for 0.2 and increasing the rotation speed, now it rotates.