ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
How to Make An Enemy Chase The Player in Unity
ฝัง
- เผยแพร่เมื่อ 26 เม.ย. 2022
- The most basic AI you can have is for your enemies to chase the player around in game. You can set this up with literally just a few lines of code, and at that point you can setup a damage system when the enemies collide with the player.
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
➤SUBSCRIBE to inflate my ego with a bigger number 💖
➤LIKE the video to help the algorithm or I'll chase you
➤Join our DISCORD SERVER and be best friends: / discord
Thanks for watching!
#unity #tutorial #bmo
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! :)
Appreciate that! I'm not going anywhere :)
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
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.
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.
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
how would i approach this in 3d?
Happy to see more from you :))
Im not going anywhere!
Really helps! Thanks a lot!
Love The Thumbnail.
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
"Thats terrifying" 😂
Let the chase begin..lol
Thanks
Awesome Video :))
my enemy just flips upside down
love ur work bro
Oh thanks it actually works🥂
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.
Thank you i love you
I'm getting a error with rb.rotation = angle; as I can't convert type float to unityengine.Quaternion?
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.
Thank you so much for that!@@GuruguyGaming
Is it possible to post the final scripts of your tutorials in the description or comments so it is easier to double-check
no he enjoys your suffering
@@user-lg9vk3ro8v based
Action doesn’t work? Any alternatives or fixes?
It doesnt work for me too, I guess he declared it somewhere else and we havent or IDK
update: FIgured it out you probably arent Including System as he is it worked for me
@@vojtavlachovsky7763 fantastic, now if only I could remember which project this was for
@@vojtavlachovsky7763 Could you explain that? I'm having that problem but I still can't figure it out
@@vojtavlachovsky7763 Can you explain this? How do i do this
How do I stop the enemy sprites from rotating along with the rest of the components?
rigidbody2d.freezerotation = true;
why does the enemy slow down when approaching the hero?
The Distance gets lower and when multiplying the distance times the speed it gets lower.
🥇
It is a great tutorial, but what about pathfinding?
you cant do path finding in 2d
Uh my Enemies just sit around and when i hit them they fly off into nothing.
nevermind i misspelled Player in GameObject.Find()
how do you fix the fly away part? they push me but when i push them back they just fly off.
this sucks for multiplayer, works great in single player
could you send the script please
aiiiiiii aia i
someone copy and pase reply to me the script i beg
L