Unity 2D Platformer for Complete Beginners - #10 ENEMIES

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 340

  • @PandemoniumGameDev
    @PandemoniumGameDev  2 года назад +26

    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.

    • @CryptoMM1
      @CryptoMM1 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

    • @PhantomAbyss
      @PhantomAbyss Год назад +1

      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!

    • @purejaguare
      @purejaguare 7 месяцев назад

      I have a problem where the person dies but keeps moving when I move over him.

    • @mashupsbyrens285
      @mashupsbyrens285 6 месяцев назад

      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@@purejaguare

  • @mrsworder
    @mrsworder 2 года назад +67

    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 года назад +8

      Really glad to help! Don't worry it's been growing steadily, also I need to be more consistent and put out more stuff

    • @PhantomAbyss
      @PhantomAbyss Год назад

      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 года назад +18

    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 года назад +3

      Thanks a lot! It's been growing steadily, we'll get there

  • @mapkocc
    @mapkocc 3 месяца назад +1

    18:42 little optimization quirk
    Putting in "if(hit.collider != null)" inside the "PlayerInSight()" method to see if it needs to get the health component of the player means it's doing this check every single frame. Plus, it re-assigns "playerHealth" with the same value every frame the player is in range. But the method already returns the result of "hit.collider != null" at the end. The DamagePlayer() method already checks "if(PlayerInSight())" to execute "TakeDamage()", so it's basically doing the same check twice.
    You can just declare the "Raycasthit2D hit" variable as private outside of the method, which means DamagePlayer() will have access to it when it's called. You end up not needing the "playerHealth" variable. So it can just be:
    private void DamagePlayer()
    {
    if(PlayerInSight())
    hit.transform.GetComponent().TakeDamage(damage);
    }
    The only way PlayerInSight() will return true (and therefore run the next line) is if the "hit" variable currently contains the player object it has collided with in the check. Had no issues trying it this way. Saved a single glorious check per frame. Mom would be proud.

  • @siyovushdodojanov9344
    @siyovushdodojanov9344 2 месяца назад

    Greatest Tutorial With All Details Ever Seen Here in my 1.5 year of learning started from WebDev to Get Understanding of Programing then Android App Development and finally half year ago started unity and that is were i want to stop Shout Out To this Man He is Incredible

  • @RMCMiner
    @RMCMiner 2 года назад +3

    Ive been waiting for so long, so happy the new one is out!

  • @maxy2479
    @maxy2479 Год назад +1

    Wow... Underrated... Code actually works unlike other codes.

  • @scorpiusjones5436
    @scorpiusjones5436 Год назад +2

    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

  • @waltersattazahn1480
    @waltersattazahn1480 2 года назад +3

    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.

  • @PokimBarran
    @PokimBarran Год назад +1

    Thank you so much I have been stuck on this for days. Really helped thanks.

  • @user-cm3em8fr9x
    @user-cm3em8fr9x 2 года назад +2

    Finally! Thanks so much! Your tutorials are really helpful and well organized.

  • @ushas3349
    @ushas3349 7 месяцев назад

    Thank you so much for the wonderful unity 2D platformer series. I enjoy creating the games along with you. Usha

  • @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 🔥

  • @XxmichaelxX321
    @XxmichaelxX321 2 года назад +1

    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?

  • @prochysolaire9055
    @prochysolaire9055 2 года назад +6

    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 6 месяцев назад

      did u solve it? and if yes, how?

    • @elizabeth16756
      @elizabeth16756 3 месяца назад

      @@sogyshorts5662 Having the same issue as well!

  • @balab1622
    @balab1622 Год назад +1

    i will not give up and finish this series !!!

  • @GeRgOyt
    @GeRgOyt 2 года назад

    'Guess i'll die' lmao you're the best :D

  • @Majitsu_san
    @Majitsu_san 2 года назад +2

    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///

  • @danieltai6494
    @danieltai6494 4 месяца назад

    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

    • @user-NguyenQuocDat
      @user-NguyenQuocDat 3 месяца назад

      my meleeAttack animation is called 2 times. How to fix it bro ?

  • @PianoGreenGaming
    @PianoGreenGaming 2 года назад +1

    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.

  • @mfspawn1474
    @mfspawn1474 2 года назад

    Following so far and loving it!

  • @PavanKumar-hs6qz
    @PavanKumar-hs6qz Год назад +1

    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.

  • @lachuchacanucha
    @lachuchacanucha Год назад

    Thank you so much for this course, it is really helpful!

  • @Ray-wt2rr
    @Ray-wt2rr 2 года назад

    Thanks for uploading. after waiting all this time

  • @aychar
    @aychar 2 года назад +4

    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?

    • @computernerd8157
      @computernerd8157 Месяц назад +1

      I think you are correct. I know this is a year old, but its awesome when people who are learning think of optimization. Personally, I am glad he did not do it because it allows people learning room to grow.

  • @malwida1022
    @malwida1022 10 месяцев назад +2

    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.

  • @rorywalker4770
    @rorywalker4770 Год назад +2

    Thanks for your tutorial! Is there a reason why you keep using Vector3 for a 2D game?

  • @patrickkusmajadi4736
    @patrickkusmajadi4736 2 года назад +1

    thANKS NOW I KNOW HOW TO MAKE A TIMER sorry for capslock im to lazy to change them

  • @endersuit8076
    @endersuit8076 Год назад +2

    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?

  • @kieranryan7625
    @kieranryan7625 2 года назад +3

    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 Год назад

      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 :
      ruclips.net/video/XIEtt4GH_Mo/видео.html

  • @khnuxsora
    @khnuxsora 2 года назад +3

    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

  • @thesilentwisp
    @thesilentwisp 2 года назад +1

    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 года назад +1

      Hey there, it would've been a bit easier probably but I wanted to start with the basics not use any packages.

  • @quinnger
    @quinnger Год назад +1

    Where did you fix the error where the enemy continues to swing his sword over your body after you're dead?

  • @tominolulino9170
    @tominolulino9170 Год назад +1

    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 ?

  • @karun7275
    @karun7275 2 года назад +3

    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 года назад +1

      i have same problem

    • @cosfia2167
      @cosfia2167 2 года назад +1

      I have the same problem ;;

    • @cosfia2167
      @cosfia2167 2 года назад

      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 6 месяцев назад

      same Problem, did u solve it?
      @@sanjanar6218

  • @gabssanto
    @gabssanto 2 года назад

    Awesome videos! Are helping me a lot to learn how to proper use Unity

  • @shashanksharma1773
    @shashanksharma1773 2 года назад

    thank you just thank you man you are just amazing

  • @MORIARTI27
    @MORIARTI27 6 месяцев назад +1

    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...

    • @stxrmx3548
      @stxrmx3548 3 месяца назад

      I have the same issue, did you fix it by any chance?

    • @stxrmx3548
      @stxrmx3548 3 месяца назад +1

      Nevermind, I fixed it. You just need to rewatch this moment - 32:15. The issue was in health script, so just write code more carefully

    • @MORIARTI27
      @MORIARTI27 3 месяца назад

      Okay

    • @user-fj3ok1om2h
      @user-fj3ok1om2h 3 месяца назад

      ​@@stxrmx3548 My enemy hasn't changed, he still beats me when I'm already dead

  • @ryanmondong9835
    @ryanmondong9835 Год назад +2

    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 Год назад +1

      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_ Год назад +1

      Solution. Disable EnemyPatrol., until Pandemonium turns his back on.
      For those looking for the answer.

  • @devdog7409
    @devdog7409 Год назад +1

    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.

  • @StigDesign
    @StigDesign 2 года назад

    Great Tutorial :D Love it :)

  • @TheTokoshi
    @TheTokoshi 2 года назад +1

    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.

  • @the-man-1520
    @the-man-1520 28 дней назад

    When do you add the Enemy Projectile?

  • @trashvideos5317
    @trashvideos5317 Год назад +1

    Hi, I´ve got a question. Where do you got the EnemyProjectile Script???

  • @PhantomAbyss
    @PhantomAbyss Год назад +1

    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!

    • @PhantomAbyss
      @PhantomAbyss Год назад +1

      Someone help as soon as possible

  • @mukundkumar3403
    @mukundkumar3403 2 года назад +1

    16:32 Hey, this problem is still there in my game and the melee enemy is not working.
    Plz help.

  • @tomtornados6236
    @tomtornados6236 Год назад +1

    When the enemy changes direction, the active projectile flips to the other side relative to the enemy. Is there a fix for this?

  • @valentinkadushkin324
    @valentinkadushkin324 Год назад +1

    One question: Enemy can move while he is attacking ( if i move away from it). Is it some quick fix of that?

  • @moedip7240
    @moedip7240 2 года назад +1

    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.

  • @PopcornGoPro
    @PopcornGoPro 2 года назад

    An easy fix for the firetrap is just to simply change the onTriggerEnter to onTriggerStay =)

  • @marutorii
    @marutorii 2 года назад +1

    Pandemonium, I have a problem with my game. I've typed the code like yours, but the problem in second 23:16 still occurs. Do you have any idea what should I repair?

    • @freestylerak6655
      @freestylerak6655 2 года назад

      Having the same problem... Did you get the solution?

    • @marutorii
      @marutorii 2 года назад

      @@freestylerak6655 no i did not

    • @freestylerak6655
      @freestylerak6655 2 года назад

      @@marutorii no problem bro, I fixed it

    • @marutorii
      @marutorii 2 года назад

      @@freestylerak6655 lucky to you

  • @aregaznauryan5911
    @aregaznauryan5911 Месяц назад

    HELP PLEASE!!!
    why changes in scene don't apply in game mode??

  • @gearsbright4599
    @gearsbright4599 11 месяцев назад

    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?

  • @gonexhausted
    @gonexhausted 2 года назад +2

    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 Год назад

      Thanks
      but my enemy doesn't activate attack animation when I go into his red zone, why?

  • @marekpuchon4878
    @marekpuchon4878 2 года назад +1

    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.

  • @mihamajer780
    @mihamajer780 2 года назад +1

    i have a problem, my ranged enemy only shoots fireballs for 1 frame and then they disappear

    • @hpgg6232
      @hpgg6232 2 года назад

      Same :/

    • @hpgg6232
      @hpgg6232 2 года назад

      Still not sure what was causing the issue but deleting RigidBody2D component and setting resetTime to 15 worked for me. Hope this helps :D

  • @Egor-kc2dx
    @Egor-kc2dx Год назад +1

    Where does string create?: №57/№67 - "invulnerable", because it's string just already done on 47:57 min

    • @Egor-kc2dx
      @Egor-kc2dx Год назад

      already see that in 51:17😁

  • @b7lee948
    @b7lee948 2 года назад +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 года назад +1

      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 года назад +1

      @@PandemoniumGameDev Does change the sprite effects the animation?

  • @novellee9493
    @novellee9493 2 года назад +2

    Hi love your videos but had a problem in wall jumping tutorial my jumping became infinite again

  • @axolon_ronyn3015
    @axolon_ronyn3015 2 года назад +1

    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

  • @WildChild343
    @WildChild343 10 месяцев назад +2

    If anyone else is having issues detecting player with RaycastHit2D change this part "boxCollider.bounds.size.x * range" to this "boxCollider.bounds.size.x" in the second parameter of the BoxCast function. For example:
    private bool PlayerInSight()
    {
    RaycastHit2D hit = Physics2D.BoxCast(boxCollider.bounds.center + transform.right * offset * transform.localScale.x * colliderDistance,
    new Vector2(boxCollider.bounds.size.x, boxCollider.bounds.size.y),
    0, Vector2.left, 0, playerLayer);
    Debug.Log(hit.collider);
    return hit.collider != null;
    }

  • @user-ye5ud2rw6w
    @user-ye5ud2rw6w 9 месяцев назад +1

    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.

  • @jamieparkin7054
    @jamieparkin7054 Год назад +1

    so my problem is with the patrol and attack of the ranged enemy it moon walks left and right (faces the wrong direction its going) and the range doesn't flip with the enemy, i've downloaded the finished copy of this episode to make sure his is working which it is, so i copy and pasted all the code related the the ranged enemy into my scripts so the codes are the same and cross referenced everything in the inspector so all the positions, scales and script inputs are the same but it still broke ...help!

    • @jamieparkin7054
      @jamieparkin7054 Год назад

      i fixed my problem just by deleting the Ranged Enemy from the Enemy Patrols "enemy" and "enemy animator" functions then putting them back into the Enemy Patrol fixed my problem

  • @micahburnside2281
    @micahburnside2281 Месяц назад

    41:28 the EnemyFireballHolder script causes the enemy fireballs to shoot at the enemy when it is facing the left. When it faces right, the fireballs shoot to the right. [EDIT] I solved this. Answer is in the reply.

    • @micahburnside2281
      @micahburnside2281 Месяц назад

      I figured out my problem. I had incorrectly set the game object hierarchy and Firepoint was not a child of RangedEnemy. If you are following along, make sure you're checking your game object Child / Parent structures. I was so tired I didn't realize I had overlooked where it was sitting. Interesting how something so small can have such a large effect.

  • @oanhtuan4245
    @oanhtuan4245 Месяц назад

    Hi, I followed the instruction at around 5:08 , i did exactly what the video shows step by step but first, it shows : "Transition Idle - Attack in state Idle doesn't have an Exit or any condition , transition will be ignored" after i added the attack condition my enemy always doing the attack anim and not idle state, Anyone know how to fix?

  • @VatsalKumarB23BB104
    @VatsalKumarB23BB104 5 месяцев назад

    @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

  • @alexcrush99
    @alexcrush99 2 года назад

    Ty for the tutorials i love u

  • @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.

  • @user-hn3px5ls2j
    @user-hn3px5ls2j Год назад

    Sorry, I followed your course. When I did the 41:48 part, I wanted the enemy in my range to be able to shoot arrows, but after he detected the player, although he shot the arrow, it disappeared instantly. Why is this? By the way, I didn't animate my arrows, could it be related to the animation?

    • @user-hn3px5ls2j
      @user-hn3px5ls2j Год назад +1

      I found the problem, my arrow point is too close to the enemy, causing it to disappear instantly when it is shot.

  • @jeffhodgson2582
    @jeffhodgson2582 2 года назад +1

    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 года назад +2

      Yeah, it's a common Unity bug. Just restart it and it should go back to normal

  • @brainy3429
    @brainy3429 2 года назад

    Thanks a lot!

  • @ushas3349
    @ushas3349 7 месяцев назад

    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.

  • @shai8559
    @shai8559 2 года назад +1

    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...

  • @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

  • @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).

  • @fajrikhoirunnisa1651
    @fajrikhoirunnisa1651 2 года назад

    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?

  • @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

  • @triplea7260
    @triplea7260 2 года назад

    Thanks a lot❤️

  • @itsyourgamer3786
    @itsyourgamer3786 2 месяца назад

    hey, was just wondering that is there any way to make the player damage the enemy through melee attacks.i followed through all the scripts but i did not wanted to add a projectile attack system but now im stuck as i dont know how to damage the enemies through melee attack

    • @itsyourgamer3786
      @itsyourgamer3786 2 месяца назад +1

      hey, nevermind. after hours of hit and trials and some useful tutorials i was finally able to get my way through it. And btw youre the goat.

    • @aknyolcu6500
      @aknyolcu6500 Месяц назад

      @@itsyourgamer3786 Good luck for you !

  • @Jeea84
    @Jeea84 2 года назад +1

    This mixed me up quite a bit 😵‍💫I'm sorry, but why didn't you use separate scripts for enemy and player? 🤔It's all mixed up. It's easy, but still all mixed up. I've watched it four times....

  • @jiayongng7498
    @jiayongng7498 2 года назад

    Why i dont see any animation set up for the fireball on explode animation?

  • @quinnger
    @quinnger Год назад +1

    I followed you exactly but the enemy just ignores me and continues to patrol. He does not stop and attack. What could I be doing wrong?

    • @gargisharmaa
      @gargisharmaa Год назад

      Did you find any solution for this?

    • @quinnger
      @quinnger Год назад

      I think so…

  • @robertyocum7200
    @robertyocum7200 9 месяцев назад

    35:06 just a reference for myself
    12:19
    17:25

  • @vihangabandara4284
    @vihangabandara4284 2 года назад +1

    45.02 patrolling behavior is not working. If anyone knows how to fix it please tell me.

  • @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!!!

  • @luciaansaldi5518
    @luciaansaldi5518 Год назад

    Hi. If I download your project from github I can't open it. I don't know why, can you help me?

  • @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??

  • @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 :(

  • @alfazul21
    @alfazul21 2 года назад

    why does my fireball only has short range of distance? it dissapear before even collide with anything

  • @screwmeiguess
    @screwmeiguess 2 года назад

    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.

  • @jeffreypopek
    @jeffreypopek 2 года назад +1

    Hey not sure if its intentional or not but this video is unlisted and can only be seen from this playlist

    • @randomacc77777
      @randomacc77777 2 года назад

      True. Same for me. Guess we’re the first since we were here before it was released

    • @ryannishad3178
      @ryannishad3178 2 года назад

      it is like this because he gave us early access to it because we are in his discord server

    • @PandemoniumGameDev
      @PandemoniumGameDev  2 года назад +2

      It was meant for people who have early access but it seems that you found a loophole :D

  • @The_McLaughlin
    @The_McLaughlin 2 года назад +1

    I've run into a bug that I can't figure out. So the line of sight was working properly with my melee enemy. However in working on the ranged enemy his line of sight is no longer flipping with him. So it starts off fine in the correct direction he's facing. Though the enemy walks backwards rather than forwards. Then when he gets to the patrol edge he turns around but the field of vision gizmo stays the same direction. so if the player is behind him, it triggers the enemy to fire a fireball. However the fireball still fires forward away from the enemy but is triggered from behind the enemy as his field of vision doesn't change. He also continues to walk backwards if you're out of his "line of sight". I've checked all my scripts to yours but they look fine to me. No errors are compiling in Unity. So I have absolutely no ideas on how to fix this issue. I also tried changing his direction of both the ranged enemy and the ranged enemy holder but this only seems to flip the sprite so he may then walk in the correct direction but his field of view still doesn't change. Same issue if I change just one of the objects direction he starts walking the right direction but his field of view stays behind him.

    • @The_McLaughlin
      @The_McLaughlin 2 года назад +1

      Well update after playing around with the x position on the ranged enemy and Ranged enemy holder I fixed the walking backwards issue. The enemy now flips but I still cant get enemy field of vision box collider/gizmo to flip. So the enemy walks forwards and heading one direction his line of sight is in front of him but the other direction the box is behind him. I know we wrote code to make the box flip too, but again I've checked all my code a few times now and I'm not seeing any errors to fix this issue.

  • @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?

  • @jimix8575
    @jimix8575 Год назад +1

    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!

    • @kidsawl
      @kidsawl Год назад

      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

  • @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

  • @KingDoodies
    @KingDoodies 2 года назад

    Hey i have a problem, when i set my layer to player he free falls through the ground, is there any fix to this?

  • @thinhnguyencong213
    @thinhnguyencong213 10 месяцев назад

    the enemy that i make do not stop and attack my character when it is in the raycast zone

  • @kalebstephens5941
    @kalebstephens5941 2 года назад

    Can you do a video that shows how to have Enemies aggro that goes with enemy patrol using a collider?

  • @reginaldsavage341
    @reginaldsavage341 2 года назад +1

    enemy teleports to location of where i did the animation
    edit: i had to apply root motion then it works.
    lmao every time i get a problem that the internet cant fix i post my problem in the comments then after a few minutes i find a fix.
    but i have another problem where the enemy is staying idle when i go inside the box

    • @jimix8575
      @jimix8575 2 года назад

      You probablly did some animations wrong. And you have to set the right tags on the player as "player" and enemy as "enemy".