Unity 2D Platformer for Complete Beginners - #10 ENEMIES

  Рет қаралды 139,791

Pandemonium

Pandemonium

Күн бұрын

In this episode we'll finally create melee enemies and ranged enemies. Then we'll add a simple patrol behavior to our enemies.
➤ Knight Sprite Pack: assetstore.unity.com/packages...
➤ Starting Project: github.com/nickbota/Unity-Pla...
➤ Complete Project: github.com/nickbota/Unity-Pla...
Consider supporting the channel on Patreon:
➤ Patreon: / pandemonium_games
➤ Discord : / discord
➤ Itch: nickbota.itch.io/​
➤ Instagram: / pandemonium_games
➤ Twitter: / pandemoniumnick​
#pandemonium​ #unity2dplatformer​ #unitybeginner​
Tags: unity 2d platformer for complete beginners,unity 2d platformer,pandemonium games,platformer for complete beginners,unity 2d enemy,unity health system,unity enemy,Unity 2D Platformer for Complete Beginners - #10 ENEMIES,unity 2d enemies,unity melee enemy,unity ranged enemy,unity 2d platformer episode 10,unity patrol ai,unity 2d ai patrol,unity simple patrol,unity simple patrol behavior,unity damage enemies,unity melee enemy ai,unity ranged enemy ai
0:00​ Intro
0:15 Enemy sprites & Animations
9:06 Melee Enemy AI
20:15 Patrolling
31:52 Damaging Enemies
33:50 Ranged Enemy AI
45:10 Disabling Enemies
48:50 Contact Damage from Enemies
49:37 Firetrap Fix
51:36 Outro & Patreon Shoutout

Пікірлер: 323
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks for everyone for the patience, this one was a pain to record, I managed to mess up the video a couple times and had to redo it. Hope everything is clear and let me know if you need help, also check the GitHub project if you need the code: github.com/nickbota/Unity-Platformer-Episode-10 For everyone who's getting UnassignedReferenceException when your fireballs hit something change this part of the code: collision.GetComponent().TakeDamage(damage); to this: collision.GetComponent()?.TakeDamage(damage); The ? will check if the object has a Health component before trying to damage it.
@maazwaqar4116
@maazwaqar4116 2 жыл бұрын
lovely videos, you are an excellent teacher, thanks for helping us.
@sahil8116
@sahil8116 Жыл бұрын
Hello sir when I hurts my enemy he get die but still moving please sir tell me
@skyherald7390
@skyherald7390 8 ай бұрын
Epic video! idk why the channel is underrated I guess no one wants to become and Albert Einstein like you!(im not smart) Ahem.. Btw the EnemyFireball is not visible when he the enemy shoots but the invisible fireball still hits the player the sorting layer on the fireballs is set to Foregrounds so idk the problem Please Help dude!
@snakejaguar477
@snakejaguar477 3 ай бұрын
I have a problem where the person dies but keeps moving when I move over him.
@mashupsbyrens285
@mashupsbyrens285 2 ай бұрын
Idk if I'm too late; but you can click the + icon in the MeleeEnemy/RangedEnemy script, and select the EnemyPatrol game Obejct in it. It would load up the script in it, and then it would also disable the EnemyPatrol script@@snakejaguar477
@mrsworder
@mrsworder 2 жыл бұрын
Probably one of the best unity tutorials creator, you dont just make us copy the code( yes doing this we would create a game, but we don't learn nothing about how to make a game by ourself) , but you explain well how the code we just typed works! Sad to see the channel really underrated :(
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Really glad to help! Don't worry it's been growing steadily, also I need to be more consistent and put out more stuff
@skyherald7390
@skyherald7390 8 ай бұрын
Yo bro can you help me with the DamagePlayer() Event in Melee Attack in the script it is saying it is unused and in the unity editor its saying its not supported so how do you fix it? pls help Epic Tutorial btw Love it!@@PandemoniumGameDev
@tapthelvete
@tapthelvete 2 жыл бұрын
I've been looking for reliable and easy to understand Unity tutorials and I hadn't found one... Until now. Your explanations are wonderfully constructed and I actually feel like I am learning. It's quite sad to see how little subscribers you have, but at least I can contribute by adding one more! Thank you for these videos and I hope you have an amazing 2022!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks a lot! It's been growing steadily, we'll get there
@PokimBarran
@PokimBarran 9 ай бұрын
Thank you so much I have been stuck on this for days. Really helped thanks.
@user-cm3em8fr9x
@user-cm3em8fr9x 2 жыл бұрын
Finally! Thanks so much! Your tutorials are really helpful and well organized.
@ushas3349
@ushas3349 3 ай бұрын
Thank you so much for the wonderful unity 2D platformer series. I enjoy creating the games along with you. Usha
@lachuchacanucha
@lachuchacanucha Жыл бұрын
Thank you so much for this course, it is really helpful!
@XxmichaelxX321
@XxmichaelxX321 2 жыл бұрын
Thank you so much for all these videos! Idk where I’d be without it!! Do you think you can show us how to make our character go between scenes, like going between levels?
@mfspawn1474
@mfspawn1474 Жыл бұрын
Following so far and loving it!
@RMCMiner
@RMCMiner 2 жыл бұрын
Ive been waiting for so long, so happy the new one is out!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks a ton for waiting!
@PianoGreenGaming
@PianoGreenGaming 2 жыл бұрын
If you want a different enemy sprite that looks a bit different there is also ninja sprite sheet on the unity asset store by the same creator as the knight one.
@danieltai6494
@danieltai6494 2 күн бұрын
If someone's fire ball is shooting without any cooldown, go to animation, and check the transition from ranged attack back to idle and make sure there isn't a trigger(ranged attack) there
@anastarek4491
@anastarek4491 Жыл бұрын
This is the best channel in the world. I learned many things from you and applied them and became good at making games. Thank you.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
This is the best thing to hear! Thanks a lot and keep getting better 🔥
@gabssanto
@gabssanto 2 жыл бұрын
Awesome videos! Are helping me a lot to learn how to proper use Unity
@thesilentwisp
@thesilentwisp 2 жыл бұрын
Thank you so much for releasing a new tutorial. Been following this series and making my very first platformer! Out of curiosity, why not use the new PlayerInput system for the controls, or the Cinemachine for camera movement?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Hey there, it would've been a bit easier probably but I wanted to start with the basics not use any packages.
@rorywalker4770
@rorywalker4770 Жыл бұрын
Thanks for your tutorial! Is there a reason why you keep using Vector3 for a 2D game?
@maxy2479
@maxy2479 Жыл бұрын
Wow... Underrated... Code actually works unlike other codes.
@marekpuchon4878
@marekpuchon4878 2 жыл бұрын
This is absolute awesome. I have just one question. When i create event on end of animation die when i kill enemy he stop using those two scripts but he will not disapeare and because of the script enemy damage can still hurt me.
@shashanksharma1773
@shashanksharma1773 2 жыл бұрын
thank you just thank you man you are just amazing
@balab1622
@balab1622 Жыл бұрын
i will not give up and finish this series !!!
@Ray-wt2rr
@Ray-wt2rr 2 жыл бұрын
Thanks for uploading. after waiting all this time
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks for waiting this long!
@StigDesign
@StigDesign 2 жыл бұрын
Great Tutorial :D Love it :)
@waltersattazahn1480
@waltersattazahn1480 2 жыл бұрын
Another good video. I got everything to work, and was able to solve any issues I had. I would like to share that the last issue I had was that my RangedEnemy Firepoint was not changing direction with the RangedEnemy's direction. I found out that the FireballHolder(the empty object that holds the Projectiles) had to have a similar setup as the Player in that it cannot be a child of the RangedEnemy.
@frederictang6599
@frederictang6599 11 күн бұрын
thx you saved me
@danieltai6494
@danieltai6494 2 күн бұрын
ur a life saver man
@GeRgOyt
@GeRgOyt 2 жыл бұрын
'Guess i'll die' lmao you're the best :D
@moedip7240
@moedip7240 Жыл бұрын
My ranged enemy keeps shooting fireballs even when the player is out of sight while he is walking in the opposite direcetion! Any reasons for that? thanks for the videos, great tutorials as usual.
@prochysolaire9055
@prochysolaire9055 2 жыл бұрын
I dont know why but i have the code completely same but my RaycastHit2D hit does not trigger when player is inside the red box
@sogyshorts5662
@sogyshorts5662 2 ай бұрын
did u solve it? and if yes, how?
@scorpiusjones5436
@scorpiusjones5436 Жыл бұрын
Great series as always! Quick thing I found at the end of this tut is the EnemyPatrol object can be very specific about what variables are active in it. You have to plug these variables in when we first made it (I think they are "Enemy: Enemy" and "Enemy:Anim". If you add an enemy to the hiarchy that also has EnemyPatrol object, you must plug those variables back in or your enemy won't move/attack/idle. Maybe I just missed something, or maybe there's a workaround, but it's not THAT bad. Just good to keep in mind
@kodysmith2532
@kodysmith2532 2 жыл бұрын
I am trying to figure out how to implement the enemy damage in my code which I have made a few tweaks to to not include player projectiles. I want to handle the damage the same way but just on the mouse click. How would I incorporate that?
@franciscospinola7883
@franciscospinola7883 2 жыл бұрын
Hey, I didn't wanted the range enemy so I didn't change the way how the script Health works. Will this cause problems for me in the next tutorials? (In my case just the audio tutorial and the chekpoints & respawn tutorials).
@aychar
@aychar Жыл бұрын
Would it not make more sense to make a base Enemy class and then have RangedEnemy and MeleeEnemy inherit from it to prevent copy and pasting your code?
@asyhhaz
@asyhhaz 2 жыл бұрын
Thank you for uploading. May i ask when u will upload the game over??
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
This weekend I'm finishing the audio & music episode, then the game over screen is coming next week probably.
@TheTokoshi
@TheTokoshi 2 жыл бұрын
Great tutorial but I have 1 mistake could you help me? When I kill an enemy he moves far away. What should i do my friend.
@cuneyt-3597
@cuneyt-3597 2 жыл бұрын
hi, great video thanks! i have one problem when i click is trigger my enemy fall down from scene can you help me about that?
@endersuit8076
@endersuit8076 Жыл бұрын
i want to congratulate you for you r good tutorial ,but i have a little issue : enemy fireballs dont go into the right direction , and even by doing what you have done at minute 41:00 it didn't worked and i don't know how to fix , do you know something to help me?
@gearsbright4599
@gearsbright4599 7 ай бұрын
14:54 Is it neccesarry to take existing BoxCollider2D and using its properties make damage area. Is it possible to add second BoxCollider2D component just for that purpose or making damage area? Or would it be less optimized to do so?
@triplea7260
@triplea7260 2 жыл бұрын
Thanks a lot❤️
@user-ye5ud2rw6w
@user-ye5ud2rw6w 5 ай бұрын
Hi there! i already follow the tutorial it was great tutorial, keep it up! but I wanna ask about the enemy health can you make the enemy health visible to the player like the player health bar but in the enemy. please make it the video tutorial cause I wanna learn how to do it, thanks a lot before.
@aeennem3896
@aeennem3896 Жыл бұрын
Thanks for the tutorial , can you please make a tutorial on how to make this multiplayer with photon server?
@kalebstephens5941
@kalebstephens5941 Жыл бұрын
Can you do a video that shows how to have Enemies aggro that goes with enemy patrol using a collider?
@quinnger
@quinnger Жыл бұрын
Where did you fix the error where the enemy continues to swing his sword over your body after you're dead?
@brainy3429
@brainy3429 2 жыл бұрын
Thanks a lot!
@sayginisbay2365
@sayginisbay2365 Жыл бұрын
Hi, it was awsome video, ı have one question. When melee enemy starts hitting animation if ı escape from it's hit box the enemy is dragged to me a bit, how can ı solve it?
@patrickkusmajadi4736
@patrickkusmajadi4736 Жыл бұрын
thANKS NOW I KNOW HOW TO MAKE A TIMER sorry for capslock im to lazy to change them
@anthonylewis3804
@anthonylewis3804 Жыл бұрын
I'm having a problem with my arrowtrap ever since I changed the enemy projectile script every time it hits the player or the wall it stays frozen there and keeps shooting. I think because it's not disabling when it hits anything. Any opinions?
@user-mw5ud9ug2z
@user-mw5ud9ug2z Ай бұрын
@PandemoniumGameDev In the unity console it is displaying that the "animator for the melee enemy has been destroyed but you are still trying to access it" Can you suggest a solution to this btw love your tutorials
@kieranryan7625
@kieranryan7625 2 жыл бұрын
Another dumb question, my ranged enemy works perfectly. Except that when he is patrolling he is moving backwards haha. Like he moves right while facing left. He hits the right edge and turns, then he faces right and moves left. I'm using a different sprite but I'm sure it's something I'm overlooking. Thanks.
@watchmytvjctechnology8448
@watchmytvjctechnology8448 11 ай бұрын
I'm not a game engine guy i prefer coding everything , but i think the problem can be resolved by change flip depending on your sprite , if it is face right by default in left controller set it to true then set it back to false in right controller ,else do the opposite. Here's an example : kzbin.info/www/bejne/jnqopadqfK2Sg9E
@quinclarke2331
@quinclarke2331 2 жыл бұрын
Hi thank you for the tutorial is amazing and s much help but I have a problem. How do I get the enemy patrol to work for lots of enemies and also two different types I set the enemy patrol as prefab and just duplicated it a lot and moved left and right edge to where I need too. But the enemies sort of bug out when more then one enemy patrol is active they don’t move inside of they’re edges or freeze up at certain points. Wondering if anyone else had this problem and knows a solution thank you!
@mukundkumar3403
@mukundkumar3403 2 жыл бұрын
16:32 Hey, this problem is still there in my game and the melee enemy is not working. Plz help.
@tomtornados6236
@tomtornados6236 9 ай бұрын
When the enemy changes direction, the active projectile flips to the other side relative to the enemy. Is there a fix for this?
@MyMike004
@MyMike004 Жыл бұрын
Not sure if someone still can answer my question but I got an issue when my player gets hit The player is out of the range of the enemy but still get damage. How to fix that issue? I am using a linecast to check if the player is in range
@doscreditos
@doscreditos 2 жыл бұрын
Do you know to make a KnockBack Effect for our player?
@prodickty
@prodickty Жыл бұрын
Thank you for the tutorial. I have a question, I have followed everything that you did in the video to fix the enemy patrol only attacking after stopping. However, mine is still the same, any clue to what might have been the cause? Edit: After reading some comments it turns out I forgot to put the knightenemy under the enemypatrol hierarchy.
@rounakghosal9727
@rounakghosal9727 Жыл бұрын
had the same issue! thanks for the heads up :D
@tominolulino9170
@tominolulino9170 10 ай бұрын
Hello, can I ask why my Enemy dissapears when i turn on the game, he goes somewhere under the ground so I cant see him ?
@ushas3349
@ushas3349 3 ай бұрын
Hello, in the firetrap episode you said you corrected so that player takes damage when he steps on to the firetrap and sit there idle. But I folled all your corrections. But still player does not receive any damage when he sits on the firetrap continuously without moving! Pl give me some hint to solve this issue.
@skyherald7390
@skyherald7390 8 ай бұрын
the EnemyFireball is not visible when he the enemy shoots but the invisible fireball still hits the player the Sorting layer on the fireballs is set to Foregrounds so idk the problem Please Help someone!
@skyherald7390
@skyherald7390 8 ай бұрын
Someone help as soon as possible
@malwida1022
@malwida1022 6 ай бұрын
I resolved an issue that bugged me for a long time: whenever the enemy changed direction, all enemy fireballs already in flight suddenly appeared on the other side of the screen, because the Enemy fireball holder changed direction along with the enemy. I couldn't figure out why this is not happening in the tutorial, and why behaviour was different for me. I finally fixed it by disabling the EnemyFireballHolder script (which follows the direction of the enemy) and instead implementing the same logic that is applied to the player fireballs (set direction in the PlayerAttack and Projectile scripts) in the RangedEnemy and EnemyProjectile scripts. Now everything works as expected, maybe this helps others with the same issue.
@KingDoodies
@KingDoodies Жыл бұрын
Hey i have a problem, when i set my layer to player he free falls through the ground, is there any fix to this?
@PopcornGoPro
@PopcornGoPro 2 жыл бұрын
An easy fix for the firetrap is just to simply change the onTriggerEnter to onTriggerStay =)
@alexcrush99
@alexcrush99 2 жыл бұрын
Ty for the tutorials i love u
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks for all the support 🙌
@rezahamidhhajhoseini4242
@rezahamidhhajhoseini4242 2 жыл бұрын
Hi. I just have a question which i cannot find the answer to, at 47:33 to 47:43 what to do. did not change RangedEnemyHolder to MeleeEnemy. I did not understand this part 47:33 to 47:43. What did you do?. Please help me
@fajrikhoirunnisa1651
@fajrikhoirunnisa1651 Жыл бұрын
I have a problem with enemyPatrol. I was follow your video many times but I can't found what's the wrong is. while on patrol to the left, he walks backwards and the scale doesn't turn to minus. Can you help me please?
@jiayongng7498
@jiayongng7498 Жыл бұрын
Why i dont see any animation set up for the fireball on explode animation?
@khnuxsora
@khnuxsora 2 жыл бұрын
for some reason the animation isnt triggering ..i dont know why..the enemy is just standing on idle....i did the code like you did but the enemy wont attack the player
@antonydavis998
@antonydavis998 2 жыл бұрын
Bro, tell me please, my character can move during the attack. How to disable script movement during animation
@mikavanschalkwijk6953
@mikavanschalkwijk6953 2 жыл бұрын
I do not have the option player at the playerLayer menu in Unity
@screwmeiguess
@screwmeiguess Жыл бұрын
please help, i followed exactly your coding and steps but the enemy patrol not moving to the right and left edge. idk wheres the problem
@momoesbilly3038
@momoesbilly3038 Жыл бұрын
Im having some troubles making it turn, for some reason it does the patrol but its not actually turning when it gets to the other side. I check the code and everything seems ok, melee one works, ranged one doesnt.
@b7lee948
@b7lee948 2 жыл бұрын
i want to ask do you know how can you make character transformation for example like goku from dragon ball love your tutorial btw
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yeah, you have a couple options. 1. Change the entire character sprite or 2. Divide the character into a couple images: hair, chest, arms etc and then change the sprite or color on each individual element like Goku's hair turning yellow.
@b7lee948
@b7lee948 2 жыл бұрын
@@PandemoniumGameDev Does change the sprite effects the animation?
@mirlikiiski9054
@mirlikiiski9054 Жыл бұрын
Thank you for the video! I have a question. How to make the enemy turn towards the player when he approaches from the back?
@AnEmortalKid
@AnEmortalKid Жыл бұрын
Probably need a ray cast behind the enemy in a box (sort of how the spike head detects in all 4 locations). You could also setup an additional collider on the backside and if you get an enter event, make the enemy turn around.
@c4rri770
@c4rri770 Жыл бұрын
friend, I have a problem, I did everything right and if I came out with an enemy, but when I create another and put the scripts into it, it doesn't hurt, it can perform all the animations but it doesn't hurt the player and it doesn't give any errors, what could it be??
@feryadrashad9561
@feryadrashad9561 Жыл бұрын
great tutorial man, but the sprite doesnt stop attacking after the player leaves the hit zone, anybody got some tips?`
@lordmwmw7576
@lordmwmw7576 Жыл бұрын
The boxcast/playerinsight function returns true no matter what, even if my player is clearly in the box. I saw that you had IsTrigger activated, but doing so makes my enemy clip through the floor. Really confused, need help!!!
@alfazul21
@alfazul21 2 жыл бұрын
why does my fireball only has short range of distance? it dissapear before even collide with anything
@highmuzik5132
@highmuzik5132 Жыл бұрын
Help me, I can't see the Collider Parameter in the scene, it seems to be hidden, I can't see to adjust
@karun7275
@karun7275 2 жыл бұрын
for some reason i get the red box but when the player walks into the range of the enemy the attack animation does not trigger and the player doesnt even get damaged. and i think the root of the problem is the raycast is not detecting the player is there as the animation when the player is in sight to attack is never called.
@prochysolaire9055
@prochysolaire9055 2 жыл бұрын
i have same problem
@cosfia2167
@cosfia2167 Жыл бұрын
I have the same problem ;;
@cosfia2167
@cosfia2167 Жыл бұрын
no idea if this is still relevant, but I had the same problem and its probably not the best way to solve it but I simply put the distance value (5th one) > 0 and that triggered the animation for me RaycastHit2D hit = Physics2D.BoxCast(boxColl.bounds.center + transform.right * range * transform.localScale.x * colliderDistance, new Vector3(boxColl.bounds.size.x * range, boxColl.bounds.size.y, boxColl.bounds.size.z), 0, Vector2.left, *0.2f* , playerLayer);
@sanjanar6218
@sanjanar6218 Жыл бұрын
Did you ever solve it? And if you did, what did you do?
@sogyshorts5662
@sogyshorts5662 2 ай бұрын
same Problem, did u solve it? @@sanjanar6218
@jeffhodgson2582
@jeffhodgson2582 2 жыл бұрын
Hey, great videos by the way. I just have a question which i cannot find the answer to, at 33:02 I clicked on the MeleeEnemy and opened my Animator, but all the animator parameters just vanished. I can't find them. the parameters are there, just no buttons are showing up. My die, is gone, moving, melee, ranged and hurt are vanished. any suggestions?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yeah, it's a common Unity bug. Just restart it and it should go back to normal
@ryanmondong9835
@ryanmondong9835 Жыл бұрын
First of, I want to say that you have a great tutorial! I have been following ur first until this video for my personal project. Unfortunately, I'm having an issue in Ranged Enemy AI. Specifically in 40:08, I could not get to play in Unity, as I encountered an error message "UnassignedReferenceException: The variable anim of enemyPatrol has not been assigned." I also see that in 39:48-39:50 in your video, which mentions how you do not have the enemyPatrol assigned. I tried following your tutorials and even tried restarting your video to see the issue, but haven't figure out how to solve it yet. What seems to be the problem and how can I solve it?
@dezaraogre
@dezaraogre Жыл бұрын
Hi, did you find the problem?
@ryanmondong9835
@ryanmondong9835 Жыл бұрын
@@dezaraogre nvm, its alrdy solved. Thanks for reqching out tho
@Animalistoria
@Animalistoria Жыл бұрын
@@ryanmondong9835 same on me , can u figure out how to solve that ?
@ryanmondong9835
@ryanmondong9835 Жыл бұрын
wht a legend, still liking my comment even tho the it is 2 months ago
@CYb3R_Tr0N_
@CYb3R_Tr0N_ Жыл бұрын
Solution. Disable EnemyPatrol., until Pandemonium turns his back on. For those looking for the answer.
@smoothdawg1433
@smoothdawg1433 2 жыл бұрын
Great Video and great series. I have one small problem that I can't seem to find. On the last part of the video about giving enemy damage, my player seems to treat them like a wall or the ground and he doesn't go through either of the enemies. I can jump on their heads and just stay there and I don't fall through. I don't know if there is some collision connection in the editor that I'm missing or what. Any help or advice would be appreciated!
@smoothdawg1433
@smoothdawg1433 2 жыл бұрын
I also won't take damage if I jump on top of them or anything and I have applied the enemy damage script and set the value to 1
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Sounds like you simply need to make the enemy collider a trigger.
@smoothdawg1433
@smoothdawg1433 2 жыл бұрын
@@PandemoniumGameDev yep that was the problem. I also noticed that with my ranged enemy he will shoot fireballs but sometimes some of the fireballs just explode right in front of him while others will actually shoot towards me. I have taken out the elements and replaced them completely. Any idea on what that problem would be? I had this problem as well with the player in episode 4 but I can't remember exactly how I fixed it
@braydenmalloy4316
@braydenmalloy4316 2 жыл бұрын
@@smoothdawg1433 It might be that the fire rate is to fast and the fireballs are colliding or you don't have enough fireballs in your pool so the fireballs are being pulled before they reset from exploding
@akeemjokosenumi7946
@akeemjokosenumi7946 2 жыл бұрын
@@smoothdawg1433 any solution on how to fix this ?
@axolon_ronyn3015
@axolon_ronyn3015 2 жыл бұрын
Hey keep getting this in your damage enemy section, NullReferenceException: Object reference not set to an instance of an object
@axolon_ronyn3015
@axolon_ronyn3015 2 жыл бұрын
Nevermind, apparently I may have installed the right extension for it
@PavanKumar-hs6qz
@PavanKumar-hs6qz Жыл бұрын
MissingReferenceException: The object of type 'Animator' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
@jeremieisaac2153
@jeremieisaac2153 2 жыл бұрын
Hey, I dont know if anyone has the same problem as me, but once the rangedenemy moves to the other side, the fireball disappears, anyone has a fix?
@madularavi7035
@madularavi7035 2 жыл бұрын
why does the enemy still move after its death instead of disappearing? please reply back soon because I have my assignment submission tomorrow :(
@TheShutupandgame
@TheShutupandgame Жыл бұрын
When the enemy dies and I walk through them it’s still doing damage. Is there a fix to this?
@user-bb4kv6os3s
@user-bb4kv6os3s Жыл бұрын
Solved the problem when enemy patrol , it's not damaging, put if (enemyPatrol != null) { enemyPatrol.enabled = !PlayerInSight(); } instead of (enemyPatrol != null) enemyPatrol.enabled = !PlayerInSight(); Hope it will help someone, because it helped me.
@khanhquoc8206
@khanhquoc8206 9 ай бұрын
Thanks but my enemy doesn't activate attack animation when I go into his red zone, why?
@gluharone
@gluharone Жыл бұрын
How to make Rotate(0f, 180, 0f) on Y axis instead of MoveInDirection(-1);? Help to modernize the script. ty
@jimix8575
@jimix8575 Жыл бұрын
Nice tutorial! I finally have my ranged enemy patroling perfectly in the scene but when I try to create a prefab of it to use it in another scene it just don't work for some uknown reason. It keeps patroling but he doesn't attack the player and I have all tags displayed correctly. I thought it was a bug but it does the same in older versions of unity. I just don't find how to solve it!
@jeevstar2630
@jeevstar2630 Жыл бұрын
hey did u fix the bug ? bcz I have the same pb T-T
@scorpiusjones5436
@scorpiusjones5436 Жыл бұрын
It could possibly be because the Ranged Enemy does't have any movement logic attached to it alone, that's in the Enemy Patrol script. It seems like anytime I remove/add a enemy to the scene, I need to plug the info into the Enemy Patrol prefab in the hiarchy to make the enemy patrol
@Unknown-ug2fd
@Unknown-ug2fd 2 жыл бұрын
Excellent and clear video. I can't find the answer to one question, can you help me? When I drag Collider 2D (14:08), it doesn't turn red, I checked the script and everything is fine. If you help, I will be very grateful.😁
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Maybe you dragged in the wrong collider? Also recheck the code and send it just to make sure. PS: Any errors in the console?
@clori31
@clori31 Жыл бұрын
How can I deactivate enemy contact damage after he die? He still can hurt me after he die
@juniorski487
@juniorski487 Жыл бұрын
hello i have problem about damage enemy with fireball, fireball not damage enemy but enemy stop moving when i shoot 3 fireball ( i copy/paste you code but not working )
@Majitsu_san
@Majitsu_san Жыл бұрын
I still have a problem when melee enemy patroling the points he doesn't stop to hit me. He goes to the end of the edge and only than makes a hit///
@prodickty
@prodickty Жыл бұрын
Hey, I also have the same problem. Did you ever figure out what it was?
@larsssssssssssss
@larsssssssssssss 4 ай бұрын
anyone else having issues with the gizmos? my unity is saying color doesnt exist in the current context?
@trashvideos5317
@trashvideos5317 Жыл бұрын
Hi, I´ve got a question. Where do you got the EnemyProjectile Script???
@ignaciogalli343
@ignaciogalli343 Ай бұрын
from the traps video
@MORIARTI27
@MORIARTI27 2 ай бұрын
Hello, can you help? Very necessary!! 1. The enemy continues to hit when he is patrolling and when he killed me. 2. When my character is dying, he continues to move, and when I jump, his image appears, what should I do? Perhaps someone knows...
@LagGamers143
@LagGamers143 3 ай бұрын
please do a vedio on adding levels into the game
@shai8559
@shai8559 2 жыл бұрын
im on the patrol part and for some reason i dont see the enemy when i start the game, unless i disable the animator and than its working good just without the animations of course... any idea what could happen?
@vellansole
@vellansole Жыл бұрын
switch off trigger in boxcollider2d of character or...
@devdog7409
@devdog7409 Жыл бұрын
Can’t you just put a script on the enemy that stores the starting position and the allow distance from start, and then do calculations in update to get the patrol behavior? Like is there a reason we need 4 objects just for 1 enemy? Genuine question.
@valentinkadushkin324
@valentinkadushkin324 Жыл бұрын
One question: Enemy can move while he is attacking ( if i move away from it). Is it some quick fix of that?
@sayginisbay2365
@sayginisbay2365 Жыл бұрын
Did you find the solution?
@thinhnguyencong213
@thinhnguyencong213 6 ай бұрын
the enemy that i make do not stop and attack my character when it is in the raycast zone
@mashanikolaeva3030
@mashanikolaeva3030 2 жыл бұрын
Спасибо большое) очень полезно
@gudumfredom048
@gudumfredom048 Жыл бұрын
'FireBall (8)' AnimationEvent 'Deactivate' on animation 'Fireball_explode' has no receiver! Are you missing a component? does anyone else get this please i need help
Unity 2D Platformer for Complete Beginners - #11 AUDIO
19:41
Pandemonium
Рет қаралды 43 М.
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 237 М.
How to open a can? 🤪 lifehack
00:25
Mr.Clabik - Friends
Рет қаралды 13 МЛН
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 32 МЛН
ИИ врага "Страж" / AI Enemy - Unity легко
17:54
Graphical Design
Рет қаралды 46 М.
MELEE COMBAT in Unity
21:07
Brackeys
Рет қаралды 1,6 МЛН
How to make a Video Game - Godot Beginner Tutorial
1:17:12
Brackeys
Рет қаралды 734 М.
How to make a BOSS in Unity!
21:54
Brackeys
Рет қаралды 654 М.
The Ultimate beginner's guide to AI with Unity & C#
19:31
Blackthornprod
Рет қаралды 101 М.
Enemy Patrol/Wander AI Unity SIMPLE & EFFECTIVE CODE! Tutorial
10:00
Зря Он Сделал Это С Ней #shorts
0:39
ARNAUT 🔥
Рет қаралды 1,4 МЛН
Which Animal Is The Best At Supervising The Thief? 🤔️
0:24
BigSchool
Рет қаралды 19 МЛН
BRONZE TO GRANDMASTER SKILL IN REAL lIFE
0:17
FRN PLAYER 444
Рет қаралды 59 МЛН
Big Construction New Challenge Smiling Critters
0:12
5G Vision
Рет қаралды 11 МЛН
Frog Prince Rush With Herobrine and Entity
0:32
Realistic Craft
Рет қаралды 41 МЛН