Smart Enemy AI | (Part 12: Team Combat System) | Tutorial in Unreal Engine 5 (UE5)

  Рет қаралды 11,752

Ali Elzoheiry

Ali Elzoheiry

Күн бұрын

Learning Goals:
1 - Assign a team number to each actor (Player or Enemy)
2 - Prevent actors on the same team from attempting to attack each other
3 - Prevent accidental attacks from actors on the same team from causing damage (No friendly fire)
To download the full project files from all my videos and use any assets I create in your own games for free, then join my Patreon. Also I would be forever thankful to my early adopters
/ alizoh
Join my Discord server to chat and mingle with the community
/ discord
Link to part 1 of the "Smart Enemy AI" tutorial:
• Smart Enemy AI | (Part...
Link to the "Damage System" tutorial:
• How to Build a Combat ...
Link to the "Projectile System" tutorial:
• How to Shoot Projectil...
Checkout my other tutorials on my channel:
/ @alielzoheiry
Chapters:
00:00 Outcome of This Part
00:53 Improving the Block Functionality of the Melee Enemy
09:56 Setting Up Team Numbers
12:04 Preventing Team Members from Sensing Each Other
18:18 Modifying Melee Attack To Not Damage Team Member
29:17 Modifying Ranged Attack To Not Damage Team Member
38:57 Fixing Bug
42:00 Outro
About me:
I've been learning game development for a few years now, I do have a background in software engineering, and I also have a background in education, so being able to combine my love of gaming and love of education is the best way to spend my time.
I am currently working on this 3rd person action adventure game as a hobby, but I am also trying to build a community, thus I am creating KZbin tutorials to find others who are interested in game development and design.
If you are interested in learning more or if you are interested in working together, please let me know in the comments.
#unrealengine #unrealengine5 #ue5 #gamedev #smart #enemy #combat #AI #blueprint #tutorial #behavior #tree #behaviortree #team #group #combat #multiple #enemies

Пікірлер: 137
@tomerhertz8502
@tomerhertz8502 5 ай бұрын
There are not enough words to explain how good this series of tutorials are, how in depth, elaborates, easy to follow considering it's not an easy subject....so I'll just say AMAZING !!!
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
I really appreciate your support Tom. I'm happy you're still following along and finding this content useful, a lot of work has definitely gone into making them, and I appreciate you watching and supporting
@brian_mayberry
@brian_mayberry 8 ай бұрын
Thank you so much for this series! I watched quite a few, including the official materials, but none of them cover making a solid enemy AI top to bottom like yours has. I've followed along since the beginning, and incorporated much into my current big project, and my now broadened understanding allowed me to complete my MegaJam game on time this week. Your methods are clear and clean, allowing flexibility to work with unique gameplay needs. Cheers!
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
You're very welcome Brian, thank you for your support and for recognizing my teaching style, I put a lot of effort in planning each video to make sure it's comprehensive yet easy to follow, so it makes me really happy when people recognize the value, thank you 🙏
@ramonexpanpan
@ramonexpanpan 8 ай бұрын
Your videos are amazing! Congratulations, I started studying Software Engineering recently and I've always been interested in the Unreal Engine. So, thank you for every video! ❤
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Thank you Ramon, Glad you enjoyed it and found it useful, Good luck on journey of software engineering
@KvltWitch
@KvltWitch 4 ай бұрын
Another Excellent Video! Thanks so much for making all this content!
@AliElZoheiry
@AliElZoheiry 4 ай бұрын
My pleasure Patrick, thanks again for watching and commenting
@gossogames
@gossogames 9 ай бұрын
Have you ever considered doing a tutorial on a NPC dialogue system? Your tutorials cover all the stuff for a scalable game and having something for dialogue would be great addition. Even more broadly just NPC interactions, Maybe taking a item from the NPC permanently effects how they interact alongside changing the interactions with other NPCs and other functionality like that. There is plenty of surface level tutorials out there but ones of the quality you make come far and few between
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
The topic of NPCs that aren't enemies is definitely interesting, I didn't consider that. But now I definitely will, thank you for the suggestions 🙏
@DamianRozploch
@DamianRozploch 9 ай бұрын
Thanks, great content 💪looking forward to more
@specops2925
@specops2925 9 ай бұрын
There is no better Chanel for learning UE4/5 like U Ali ^^ Marvelous I really appreciate works like this You deserved that
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Wow thank you so much for the kind words, and even more for supporting me on Patreon, I really really appreciate you for that 🙏
@specops2925
@specops2925 9 ай бұрын
@@AliElZoheiry when I saw this channel I became A patreon ヽ(`д´;)/❤
@Shizuma450
@Shizuma450 9 ай бұрын
Heya! Your reaction at the end of the video when you see your AI fighting each other is so funny haha, (reminds me a lot of myself) Because we can feel that you love it, we can really feel your passion, developing something autonomous, it's so satisfying! (I'm a C-rpg fan, so when I see what you're teaching us I'm completely fulfilled) Thanks for this excellent video as usual, it's a pleasure to see you teach us with such passion, and with a smile! I'm off to see my AI fight it out! :P
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hey Shizuma, hahaha I appreciate that. I really do enjoy this and I'm very passionate about this intersection of Gaming, Development and Education. I'm happy to hear that you can feel my passion 😊🙏
@theindiegamedude
@theindiegamedude 9 ай бұрын
Ditto 😄
@alraffa5090
@alraffa5090 Ай бұрын
I must have watched this series 3 times already. Amazing work and thank you again for doing this for us ! When dealing with ranged attacks, I tried to make it so that instead of the same team member not taking damage and having the projectile pass right through the same team member, I wanted the enemy to act off of the line trace detection of the player character only. In other words, readjust its position and only fire when it gets a good trace on the player character only. After attempting this, there is no stopping the silly AI accidentally moving within the line of fire once the projectile is in motion! I doubt there is anything that can be done to prevent that part from happening. At that point, the same team member deserves to take that damage, haha !!!
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey there! First of all, thank you for the amazing feedback, I'm thrilled to hear that you found the series so helpful 🙏 As for your ranged attack issue, it can be quite tricky to prevent accidental movement causing friendly fire, but experimenting with the AI's navigation and line trace settings may give you some control over this. Good luck with your implementation, and thanks for sharing your experience!
@dreambadger
@dreambadger 9 ай бұрын
A flying enemy would be cool, and how it works with things like navmeshes. Like cacodemon from doom or an attacking bird etc.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Ohh interesting idea! I'll definitely consider it
@roydash5657
@roydash5657 9 ай бұрын
It's already not smart AI. Its FANTASTIC AI for AAA projects! Thank you so much. Your tutorial just awesome. I am learning so much things.
@roydash5657
@roydash5657 9 ай бұрын
My Dear & Amazing Friend please forgive me my question. If you have discord. You can send me? If I am got any issue you can help me... Anyway Thank you so much
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Happy to hear you say that Roy, glad you liked it. Feel free to join the Discord server here discord.gg/QEdDAmfP
@roydash5657
@roydash5657 9 ай бұрын
@@AliElZoheiry Thank you so much! Thank you! I wish you all the best
@abdulnabi135
@abdulnabi135 9 ай бұрын
Like you work dont stop keep grind
@DOMINATOR-qv6yv
@DOMINATOR-qv6yv 9 ай бұрын
Thanks ! One more time on time ! ME WAITING FOR THIS PART FOR A LONG TIME : AS IN RPG , DEVIL VS GOOD IS NECESSARY!!
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Awesome! Glad you liked it 🙏
@theindiegamedude
@theindiegamedude 9 ай бұрын
Awesome content as always. Thanks so much :)
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
You're very welcome 🙏 Thank you again for the support, glad you found it useful
@theindiegamedude
@theindiegamedude 9 ай бұрын
​@@AliElZoheiry - Of course :) As mentioned before, your videos are better explained, compared to the paid courses I've gone through. I noticed that bug you fixed right the end of this video. Was trying to sort it out along the way. Sometimes the Melee would block the first shot, then begin attacking the second shot even on the same team. I had a feeling it was right in that area of the blueprint, before setting the EnemyBase's State to Attacking. After digging through the logic handling of the Attack State in other areas of the prints. So I was happy to see your fix for it :) I enjoy keeping the blueprints super tidy, similar to how you do it. I'm a bit OCD about keeping things straight as well. Constantly highlighting nodes and pressing "Q". Sometimes it sets other things out of alignment XD I'll try to brainstorm some suggestions of where this series could go. Hopefully I'll have an idea or two to share on the next video of the series. Keep up the great work! Take it easy ✌
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
@@theindiegamedude Haha yeah that was an annoying bug, I'm glad I managed to encounter it before the video was released. Yeah and regarding straightening those lines, I just can't live with myself if they are crooked hahah
@theindiegamedude
@theindiegamedude 9 ай бұрын
@@AliElZoheiry - I hear you, hahaha XD
@onlyonedk
@onlyonedk 2 ай бұрын
Thanks Alawi!
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
You're welcome! I'm glad you found the content useful. Thank you for watching and commenting 🙏
@ZimMabu_GameDev.
@ZimMabu_GameDev. 9 ай бұрын
crazy! thanks!!!
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
You're welcome!
@showcast4371
@showcast4371 9 ай бұрын
Buddy your series is incredible, thanks for this amazing series man. I wanna suggest why Don't you improve the AI by adding or improving the switching target function in the AI so that once an opponent gets away certain distance , and other opponent comes closer then the AI could switch the target, because right now the AI keeps chasing a single opponent until it forgets
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
You're welcome man, and thank you for watching 🙏 Thank you for the suggestion I've been considering adding a targeting system indeed so the AI is constantly revaluating who to attack based on a set of conditions, not sure if it'll come soon, but I'm definitely considering it
@drakouzdrowiciel9237
@drakouzdrowiciel9237 2 ай бұрын
Good job
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Thanks! I appreciate your support 🙏
@JoMarcos28
@JoMarcos28 9 ай бұрын
Your series is incredible. I wish it included a "long range melee system", something like a jump attack. Usually the melee attack never hits the controlled character if he keeps running.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Thanks for the suggestion, I was indeed thinking of adding some "Common attack patterns" to the enemies, which would include charge attacks, heavy attacks, AOE attacks, etc..
@JoMarcos28
@JoMarcos28 9 ай бұрын
Nice.. Looking forward for that! @@AliElZoheiry
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Hey Jo, just wanted to let you know that I'm currently working on the Long range jump attack tutorial and will be the next video I release (in a couple of days) Thanks for the suggestions ;)
@JoMarcos28
@JoMarcos28 8 ай бұрын
@@AliElZoheiry you are my hero :D
@alexold4126
@alexold4126 Ай бұрын
u are GOD. rly. Awesome lessons. Awesome English and explanation. Only i think u need an "electric node" plugin :D for dont get messy with spagetti issue
@AliElZoheiry
@AliElZoheiry Ай бұрын
Thank you for your kind words! I really appreciate your feedback and the suggestion for the "electric node" plugin. I do use it in my own projects, but for my videos, I like to keep the default look
@kellowattentertainment
@kellowattentertainment 9 ай бұрын
I would love for you to to a Friendly AI, that accompanies the player. You could also choose to have them start or summon them when needed. (I prefer a human-like Friendly AI) That would be really awesome. I am looking forward to the boss AI as well.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
I'll definitely consider it, thank you for the suggestion 🙏
@cursedbishstudio
@cursedbishstudio 9 ай бұрын
Super clean video as always, Still loving ur work. Question, you do a lot of casting to in the behaviour tree, this fires every tick of the behaviour tree? like - (event receive execute ai) - (cast to enemy) - (attack). is that ok to do that? will it scale with a large game? is there a better way to do it? like a single cast and store the enemy as a reference?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Replied to your other comment ;)
@kellowattentertainment
@kellowattentertainment 9 ай бұрын
You are the GOAT
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
I appreciate it ☺️🙏 I hope I can live up to that
@danielfernandes8832
@danielfernandes8832 2 ай бұрын
If you are using a trace on the sword that fires with a timer, you might have a problem with the function to hit only non team members, the solution i found was to add an array on the enemy melee and pass it to the function instead of using a local variable, then set it value back on the enemy melee after the function has ended.
@AliElZoheiry
@AliElZoheiry 2 ай бұрын
Thanks for sharing your solution! It's great to hear how you overcame that issue. Always good to find creative workarounds to make things function smoothly.
@user-xv6hh8iw8m
@user-xv6hh8iw8m 3 күн бұрын
I'm having this issue, can you elaborate on that, thanks
@user-xv6hh8iw8m
@user-xv6hh8iw8m 2 күн бұрын
Thanks, I’ve solved it using your method.
@demonics7549
@demonics7549 9 ай бұрын
Let's goooo
@ashwinj9879
@ashwinj9879 8 ай бұрын
Interesting , clean and better version of codelikeme tutorial, is this end of this tutorial? Or more will come
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Thank you 🙏 I appreciate your comment. I definitely aim for clean code all of the time as my top priority. There will be more to come soon, though the next video won't be a continuation of this series, but the one after will (most likely)
@proxima7199
@proxima7199 8 ай бұрын
THank you one more time! Looks like bugs - now if there is a fight 5x5 for example, after killing an opponent - enemy unequip the weapon and equip it again if it's seen the new enemy - if a bot kills the opponent and there are some of his teammates fighting behind his back - the bot will unequip the ewapon and do nothing until takes some damage or sees the enemy. Some ideas/features for the futurevideos: - if there are 5 bots in one team for example and one of them sees the enemy - the one who has seen the enemy tells the other enemy's location and they all go to help to the first one - a bot can change a target . For example, one enemy hits 5 damage, another one hits 25 damage, so the bot priority is to kill the strongest one first - if ist is a team fight and a bot's hp / stanima is low - he will fall back, recover HP and after that return back to fight - bots from one team tries to kill the weakests enemies from the another team first
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Hey Proxima, thank you for the suggestions, I will be addressing some of these in later videos
@PoslesvetStudio
@PoslesvetStudio 9 ай бұрын
Hi, friend! Thanks for your tutorials. Can you tell me if it is possible to adapt this system so that enemy bots would also attack the player you control and last between themselves?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
It's possible for the AI to attack any target as long as they are on a different team, so what you're asking for should be achieved easily
@MrPangahas
@MrPangahas 8 ай бұрын
nice tutorials.any chance you can make a video about destroyable enemy spawners that progessively spawns harder versions of enemies over time or when a certain variable reaches a certain value
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
I made a mini game like this, is this what you're looking for drive.google.com/file/d/1aWKjOi7ZRw-YEJZCo4y8qOaatdPlpQwP/view?usp=drivesdk ?
@velocifossa
@velocifossa 9 ай бұрын
Fantastic video once again! Do you think we'll get a parrying video soon?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Thank you, glad you liked it 🙏 parrying could be interesting indeed, do you want to see the enemy parry or did you mean the player parry?
@velocifossa
@velocifossa 9 ай бұрын
First one, then the other lol. But seriously, I think either system would be dope. I think you already added reference to it in your enum right? I just want to see more vids from ya! Great work once again!
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
@@velocifossa Indeed, I already have the trigger in place, now we just need to add the ability itself, I'll definitely consider it
@SH-qo7yg
@SH-qo7yg 5 ай бұрын
Thank you for your great tutorial videos. In the case of projectiles, for example, in MOBA games, projectiles not only do not apply damage to the same team, but also pass by without hitting. How can this be implemented?
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Thank you! Glad you're enjoying this series. The team system I setup in this series only prevents enemies from damaging each other, it doesn't prevent projectiles from colliding with other enemies. Because the projectile collision settings is set to "block" on all channels. If you want to be able to have the projectile ignore some actors and not others, then it should be changed so that it "overlaps" with all channels instead of "block" and you have to change the collision handling from "On Hit" to "On Overlap" and then you can check if you're overlapping with a team mate, then dont so anything, but if you overlap with a foe, then do the damage and everything else. You can also achieve something similar with "Custom collision channels" but that will mean you need a custom channel for each team, so depends on what approach you prefer
@A1tale
@A1tale 8 ай бұрын
Hey! This tutorial is very useful, I'm looking forward to a tutorial on a boss, I think it will be very cool. thanks:)
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Thank you, glad you enjoyed it 🙏 any particular type of boss fight you're looking for?
@A1tale
@A1tale 8 ай бұрын
Like Dark souls iii Gundyr,it can grab me,and there are two phases, with different behaviors. I can't figure out how to do it@@AliElZoheiry
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Most of the boss fight requests i got have been for a "Dark souls type" boss fight, so I'll probably be doing that 😅
@BooneyianLogic
@BooneyianLogic 6 ай бұрын
did i miss the part where you added the "damageCauser" to the take damage function? I feel like i was following along. how did i miss this, now i dont know how to implement that. When I add the "damage Causer" to the Damageable Interface, and added it to the BPC_Damage component, in the BP_Enemy_Base the damage response custom event, cannot take the attack target pin from the set state as aggressive, because it causes an error with the bind event on damage response in the BP_Enemey_Base's On-Begin-Play execution line.
@AliElZoheiry
@AliElZoheiry 6 ай бұрын
That was added in part 8.5 to fix the bug where the enemy wasn't responding to damage correctly (bug 2)
@kellowattentertainment
@kellowattentertainment 8 ай бұрын
Hello Ali, I've noticed that the Ranged enemy can shoot you from extreme distances where he can't even see the player. I'd like to modify this. If the Ranged enemy is damaged, and the attack target cannot be seen, I'd like the Ranged enemy to look around in the direction where the damage is coming from... And not necessarily the exact location where the Attack actually is coming from. This last part applies to Melee as well. Say for example, I fire a projectile from a distance of 10,000 cm. Even tho the AI can't see that far, the Ranged enemy shoots that far and the Melee enemy runs to that point. This is unrealistic. Also instead of firing a line trace to the target, I'd like the Ranged Enemy to fire and actual projectile to the target. That way, the player can dodge the Ranged Enemy's attack.
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Hey, so indeed, now on damage response we tell the enemy to go attack the player right away, what you probably want to happen, is on damage response, just get the enemy to face the direction in which the damage came from, and maybe move to the seeking state. And regarding the projectile vs trace on bullet, that is definitely possible, and you can see how I do that in my projectiles tutorial kzbin.info/www/bejne/npy0apV7rNWZjJosi=7zYHWpBCBdlOR0jl
@Restart-Gaming
@Restart-Gaming 9 ай бұрын
Will you be covering how to add a different character mesh other then the ue5 character
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hey, I was considering that for the next enemy indeed. It shouldn't be much different from the Mannequin though
@proxima7199
@proxima7199 9 ай бұрын
Thank you! Haven't watched yeе(on 8th video now) but I know in advance that the video is awesome :) A question pls: For object which AI can control, in my case a sailing ship - can behaviour trees be used or what should be used for that? I want to create some ships battle mechanic like in Assassin Creed 4 Black flag or Age of Pirates 2: City of Abandoned ShipsThank you
@Yggdrasil777
@Yggdrasil777 9 ай бұрын
AI can be used for whatever you want it to be used for. It could be used for the trash on the ground, the trees in the background, the traffic light on the street. Even the sailing ship in the water. An example: sailing ship behaviour tree can be used to look for a fjord or dock or lighthouse or enemy (either on land or water) and act accordingly. Another example: the discarded soda can can use its behaviour tree to determine the best path to the trash container located on the street and roll itself to that trash container, avoiding enemies that can crush it along the way. Maybe even communicating to the traffic light so that the flow of traffic can be manipulated so that the soda can can roll freely to the trash.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
You're most welcome. And regarding your question, if your ship needs to do some complex actions based on priority and information from the world, then you can definitely use behavior trees for that
@proxima7199
@proxima7199 9 ай бұрын
Thank you for your answers!
@occy999
@occy999 8 ай бұрын
I tend to find that my enemies will try to run behind me when strafing and they get stuck on me, is there any way to fix this or have i missed something?
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
For the Melee enemy, we prevented that by adding a distance check in the EQS that makes them choose the closest point on the strafe circle, so they never cross diagonally and get stuck on the player. For the ranged enemy, we have them choose the furthest point, which could be behind the player, if that's whats causing issues for you, then you can play around with that EQS till you get the desired behavior
@waadi3ach569
@waadi3ach569 Ай бұрын
im starting to second guess myself, for my block i just added a new variable for parrying and in the behaviortree before the Parry is called i set the parry variable to a random bool with weight and only call block if its true otherwise fail the execute
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey there. If you keep following the series you'll see that I add a block and parry functionality to the player that might help you understand the best approach. It's part 19
@InnerspaceX
@InnerspaceX 9 ай бұрын
Hi, for the future parts: Maybe AI can use items, like turret on the ground? Ps: Still thanks for the tutorials.
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Ohh that's a very cool idea, interacting with the environment, I like it 👍 I'll add it to the list ;)
@paulr3001
@paulr3001 8 ай бұрын
How would you implement this kind of system in a large amount of Enemy AI's?
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
It should be usable for a large amount of AI just fine. Or do you mean large as in hundreds of enemies?
@ijaviercri4311
@ijaviercri4311 9 ай бұрын
Could you please make a tutorial on how to do a death animation? where the enemy catches you and the camera rotates to the enemy and it plays an animation and then respawns?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hmm... That's very specific, but I'll consider doing a death/respawn mechanic
@Der_Punisher
@Der_Punisher Ай бұрын
Hi, I have a problem, the AI is not attacking each other, But attacking the player, tell me where to look for the problem? --- Fix it,Just add AIPerceptionStimuliSourceComponent to BP_Enemy_Base and put a check mark in this field "Auto register as Source" add Register as Source for Senses "AISense Sight"
@AliElZoheiry
@AliElZoheiry Ай бұрын
Hey there! Thanks for sharing the solution! I'm glad you were able to resolve the issue and I appreciate you helping out others who might come across the same problem. Happy coding!
@kellowattentertainment
@kellowattentertainment 9 ай бұрын
So I've noticed something. When the AI is Idle, it has an animation that turns the head from left to right and back and loops. I've noticed that when the AI does turn his head, the sight perception cone of view doesn't move along with the head, it only moves when the AI's entire body goes in a specific direction. I'd like to change that so that the cone of sight goes wherever the AI's head goes. I'm planning on adding turrets, which don't move but do scan the area and I want to cone of sight to be updated with the area scanning. So only the top part of the turret will rotate for the scanning and I'd like the cone of sight to rotate along with that. So when targets are seen, the turrets will fire projectiles at the target. So do you or anyone else know how to add that functionality?
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
The AI perception is attached to the AI controller and not the pawn, so it will check the rotation of the actor that it's controlling but not a specific part of the actor. If you want your turret to do a scan with the top part, then rotate the entire actor when doing the scan, then "unrotate" the bottom part of the turret so that it looks like only the top part is rotating
@user-xv6hh8iw8m
@user-xv6hh8iw8m 3 күн бұрын
Hi,Ali.I'm using a trace on the sword that fires with a timer, My code still manages to damage the character multiple times, when I try to debug, I don't have this problem when I run node by node, how can I fix this situation
@AliElZoheiry
@AliElZoheiry 2 күн бұрын
If you're doing a multiline trace, that means you can hit the same actor multiple times, so make sure that you are correctly adding them to the array of damaged actors, and you're checking if they are in that array before damaging them again. Also, ensure that the check if they are in the array or not actually happens AFTER they are added to the array, because it sounds like you have a problem with the order of execution
@user-xv6hh8iw8m
@user-xv6hh8iw8m 2 күн бұрын
@@AliElZoheiry Thank you, I have already solved the problem
@user-bj8bs3rg5q
@user-bj8bs3rg5q 3 ай бұрын
У тебя всегда лучшее.
@AliElZoheiry
@AliElZoheiry 3 ай бұрын
Спасибо за добрые слова! Рад, что мои уроки вам нравятся 🙏
@Lifeequipment
@Lifeequipment 9 ай бұрын
hi ali plz you make a shooter enemy cover system
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hey! Thank you for the suggestion, I will definitely consider it 🙏
@fxclimber
@fxclimber 2 күн бұрын
When enemies from different teams merely circle each other without ever attacking, what might be the mistake I made?
@AliElZoheiry
@AliElZoheiry 2 күн бұрын
Double check the condition in the HandleSensedSight function in the AI controller, where we check if the actor sensed is on the same team or not, and if not, it will attack them. So double check that part and make sure you didn't miss anything
@user-kk5xj3ey6m
@user-kk5xj3ey6m 8 ай бұрын
Could you give the AI ability to open the door if player open it and enemy see he goes from that door
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
So like more complex navigation depending on obstacles the AI can interact with (such as doors). Interesting idea, I'll definitely consider it
@user-kk5xj3ey6m
@user-kk5xj3ey6m 8 ай бұрын
@@AliElZoheiry I hope you'll do it and there's more idea😸 how about add new enemy type like zombie☠ like resident evil and more idea how can do AI throws something like axe or knife and I've many idea if you want😁 because AI my nightmare😰 but now I've been watching your tutorials any something can't scare me😋 keep moving and I'm Arabic
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
I'm considering making tutorials on how to recreate "popular enemy attacks" like short range, long range, jump attacks, throw attacks, charge attacks etc.. so that will cover a lot of what you're suggesting
@PinducaGigante
@PinducaGigante 7 ай бұрын
i'm try to make a companion but i don't know hot make this
@AliElZoheiry
@AliElZoheiry 7 ай бұрын
I don't have a tutorial on that, but there are others on KZbin
@derakon4791
@derakon4791 9 ай бұрын
can you plz make wave of monsters (spawn) like in plants vs zombie. Or like in movie world War z where lots of zombie move together
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Hmmm... Interesting idea, I'll definitely consider it 🙏
@derakon4791
@derakon4791 9 ай бұрын
@@AliElZoheiry love you tnx
@austinrikestoplay
@austinrikestoplay Ай бұрын
If your Nav Link Jump doesn’t work anymore, it’s because of the Crowd AI Controller.
@AliElZoheiry
@AliElZoheiry Ай бұрын
Thank you for the tip! 🙏
@occy999
@occy999 8 ай бұрын
i moved my ais to a new level and they cant move?
@AliElZoheiry
@AliElZoheiry 8 ай бұрын
Don't forget to add a NavMesh volume in your level
@occy999
@occy999 8 ай бұрын
@@AliElZoheiry yup just remebered that and came to comment hahahah
@addkasugare4325
@addkasugare4325 5 ай бұрын
My code still manages to damage the character multiple times, it somehow got to do so by Adding the hit actor to the array of damaged actors then somehow it removes it and adds it again. So the printed result would be: Hit Did not hit Hit Did not hit Hit Did not hit And so on, this is on one attack swing btw and the small enemy minion killed me in one swing lmao.
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Make sure you're only emptying the array of hit actors at the very beginning or end of the loop, but never during the loop body
@addkasugare4325
@addkasugare4325 5 ай бұрын
@AliElZoheiry I never had a clear node on any, not in the end, start or even in the body of the loop but it still results to the same thing. Now that I viewed the code, the problem seems to be something else aswell, somehow in your code, the branch regarding "if the target is found in the array of damaged actors" condition, it will tell if the condition is true or false, but in my case it fires off true and false at the same time, I also realized but I've been following your videos the exact same ways yet mine always reacts differently, my UE4 is really buggy lmao.
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
​@@addkasugare4325 if you still can't fix it, I suggest joining the Discord server and asking your question there. Like in the description
@addkasugare4325
@addkasugare4325 5 ай бұрын
@AliElZoheiry it's alright, I am still new to Unreal Engine but I managed to create a similar set of code that fixed the problem never thought I could do it ngl, although it's not a function but aslong as it works it'll be good. I'm now just wondering how you could make a Health Bar for the player that shows in the screen instead of a 3D one, thanks for the tutorials BTW it helped alot! :D
@AliElZoheiry
@AliElZoheiry 5 ай бұрын
Checkout part 8.5 of this series, I move the healthbar to be on the HUD instead of a 3D one@@addkasugare4325
@aramxgamer6777
@aramxgamer6777 9 ай бұрын
انت عربي ؟
@AliElZoheiry
@AliElZoheiry 9 ай бұрын
Yes, I'm Egyptian
@aramxgamer6777
@aramxgamer6777 9 ай бұрын
@@AliElZoheiry انا من العراق اسمي عمر الزهيري متى تشرح بالعربي ؟
@abdulnabi135
@abdulnabi135 9 ай бұрын
Brother do you have discord server to join❤
I SUCK At Developing Enemy AI. Let's Fix That.
11:43
Intra
Рет қаралды 10 М.
Can you beat this impossible game?
00:13
LOL
Рет қаралды 57 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 56 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 149 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 24 МЛН
The Most Common Mistake Beginners Make in Unreal Engine | UE5
12:17
Ali Elzoheiry
Рет қаралды 88 М.
Making a Souls Like In A Month
15:32
Emis
Рет қаралды 568 М.
Bow & Arrow Masterclass | Unreal Engine (UE5) | Part 1
44:04
Ali Elzoheiry
Рет қаралды 14 М.
I Made Elden Ring Clone In 1 Week (Unreal Engine 5)
22:46
AstrumStudio
Рет қаралды 50 М.
The Blender to Unreal Engine Workflow
8:07
School of Motion
Рет қаралды 557 М.
How I Made Smart Enemy AI in My Indie Game🧐 DevLog 3
5:23
BlackCitadel Studios
Рет қаралды 16 М.
Why Dependencies are Bad and How To Avoid Them In Unreal Engine | UE5
26:40
ЗАХОТЕЛА В ТУАЛЕТ НА УРОКЕ в ROBLOX!
21:40
Family Play TV
Рет қаралды 291 М.
😨 Никогда Не смотри на Эту Луну в Майнкрафт
37:02
CyberBrawl - The Last Sacrifice
1:35
Brawl Stars
Рет қаралды 1,2 МЛН