How to Make An Enemy Chase The Player in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 50

  • @EasyGetFreezy
    @EasyGetFreezy 2 ปีที่แล้ว +22

    Hi man, I just wanted to say that I really like your style and I hope that you don't end. Brackey left a hole in us and you're doing great in filling some parts. THANKS! :)

    • @BMoDev
      @BMoDev  2 ปีที่แล้ว +8

      Appreciate that! I'm not going anywhere :)

    • @GlitchingMind
      @GlitchingMind 2 หลายเดือนก่อน

      @@BMoDev :(

  • @mike_b10
    @mike_b10 2 ปีที่แล้ว +6

    love these quick tuts, would be cool to see a side-scroller version of this, and also curious how you would go about adding knockback on collision in this top down version

  • @zoomyprodev
    @zoomyprodev 2 ปีที่แล้ว +2

    Thank you so much. I don't usually write comments but this was a lifesaver! Originally I was looking for something else, but this was much more simple. This saved me hours of more headache.

  • @iamandrewj
    @iamandrewj 2 ปีที่แล้ว +2

    Subbed! Thanks so much.
    Can you pleaseeeee make more of these videos, and also that follow up video to this that you were talking about.
    If you make more videos in the next few weeks on SIMPLE tutorials like this that can have a big impact on my AI Game project, I will watch them religiously!
    Good work

  • @i_am_set
    @i_am_set 2 ปีที่แล้ว +1

    Happy to see more from you :))

    • @BMoDev
      @BMoDev  2 ปีที่แล้ว +1

      Im not going anywhere!

  • @shockingchris9809
    @shockingchris9809 ปีที่แล้ว +1

    Been enjoying your tutorials, even a year later. Very simple and I was able to incorporate it into a system I already had in place fairly easily.
    Not that it is anything of importance, but you may go listen to Sunless Khan (Rocket League youtuber), you two sound similar and it caught my mind as I watched.

  • @axelsmaxel
    @axelsmaxel 2 ปีที่แล้ว +6

    how would i approach this in 3d?

  • @mcleverm01
    @mcleverm01 2 ปีที่แล้ว +1

    Really helps! Thanks a lot!

  • @iiropeltonen
    @iiropeltonen 2 ปีที่แล้ว +2

    Love The Thumbnail.

  • @dubstudio5541
    @dubstudio5541 2 ปีที่แล้ว +2

    Awesome Video :))

  • @TheGhostleyy
    @TheGhostleyy ปีที่แล้ว

    How come the enemies slow down when they get closer to the target? it doesnt show this in the video but it happens in my project when i use this script you wrote.

  • @patrickslater187
    @patrickslater187 2 ปีที่แล้ว

    love ur work bro

  • @eileeng2492
    @eileeng2492 2 ปีที่แล้ว +3

    Let the chase begin..lol
    Thanks

  • @xDTHECHEMISTx
    @xDTHECHEMISTx 2 ปีที่แล้ว +1

    Just wondering if you will make a tutorial that shows how to have the player get hit by enemies and get knocked back. In particular im looking for methods that mirror old NES games like Mega Man. Castlevania get hit and knock back effects are. Subbed btw. You have some good tutorials to follow

  • @Sniiiface
    @Sniiiface 2 ปีที่แล้ว +1

    I'm getting a error with rb.rotation = angle; as I can't convert type float to unityengine.Quaternion?

    • @GuruguyGaming
      @GuruguyGaming 2 ปีที่แล้ว +1

      Had the same problem, my issue was because when I was declaring the rb variable at the top, I set it as Rigidbody instead of RigidBody2D like BMo used in the video.

    • @Aetal
      @Aetal ปีที่แล้ว

      Thank you so much for that!@@GuruguyGaming

  • @TransGuyShane
    @TransGuyShane 2 ปีที่แล้ว +3

    "Thats terrifying" 😂

  • @johnnjoroge8868
    @johnnjoroge8868 2 ปีที่แล้ว

    Oh thanks it actually works🥂

  • @h7_k7
    @h7_k7 2 ปีที่แล้ว +2

    Is it possible to post the final scripts of your tutorials in the description or comments so it is easier to double-check

  • @TartarusHimself
    @TartarusHimself 2 ปีที่แล้ว +1

    Action doesn’t work? Any alternatives or fixes?

    • @vojtavlachovsky7763
      @vojtavlachovsky7763 2 ปีที่แล้ว

      It doesnt work for me too, I guess he declared it somewhere else and we havent or IDK

    • @vojtavlachovsky7763
      @vojtavlachovsky7763 2 ปีที่แล้ว

      update: FIgured it out you probably arent Including System as he is it worked for me

    • @TartarusHimself
      @TartarusHimself 2 ปีที่แล้ว

      @@vojtavlachovsky7763 fantastic, now if only I could remember which project this was for

    • @CosmicFluSports
      @CosmicFluSports 2 ปีที่แล้ว

      @@vojtavlachovsky7763 Could you explain that? I'm having that problem but I still can't figure it out

    • @KRAXi-
      @KRAXi- 2 ปีที่แล้ว

      @@vojtavlachovsky7763 Can you explain this? How do i do this

  • @nguyenhuynhthienphu5286
    @nguyenhuynhthienphu5286 ปีที่แล้ว

    Thank you i love you

  • @reginaldsavage341
    @reginaldsavage341 2 ปีที่แล้ว +1

    my enemy just flips upside down

  • @jordenshukla6873
    @jordenshukla6873 2 ปีที่แล้ว

    How do I stop the enemy sprites from rotating along with the rest of the components?

    • @Matt-mg1kk
      @Matt-mg1kk ปีที่แล้ว

      rigidbody2d.freezerotation = true;

  • @firewatch123
    @firewatch123 2 ปีที่แล้ว

    why does the enemy slow down when approaching the hero?

    • @leonschaub7414
      @leonschaub7414 2 ปีที่แล้ว

      The Distance gets lower and when multiplying the distance times the speed it gets lower.

  • @leonschaub7414
    @leonschaub7414 2 ปีที่แล้ว

    Uh my Enemies just sit around and when i hit them they fly off into nothing.

    • @leonschaub7414
      @leonschaub7414 2 ปีที่แล้ว

      nevermind i misspelled Player in GameObject.Find()

    • @Nitys
      @Nitys 2 ปีที่แล้ว

      how do you fix the fly away part? they push me but when i push them back they just fly off.

  • @mtyuiop07
    @mtyuiop07 2 ปีที่แล้ว

    It is a great tutorial, but what about pathfinding?

    • @peachy8335
      @peachy8335 2 ปีที่แล้ว

      you cant do path finding in 2d

  • @godzillakingkongvenom
    @godzillakingkongvenom 2 ปีที่แล้ว +2

    🥇

  • @Pixelatic0733
    @Pixelatic0733 2 ปีที่แล้ว

    could you send the script please

  • @sillyninja65
    @sillyninja65 ปีที่แล้ว

    this sucks for multiplayer, works great in single player

  • @piotrwalczak6261
    @piotrwalczak6261 ปีที่แล้ว

    aiiiiiii aia i

  • @peachy8335
    @peachy8335 2 ปีที่แล้ว

    someone copy and pase reply to me the script i beg