Simple Enemy Follow AI in ONE MINUTE in Unity!
Ойындар
In this tutorial I'll show you a quick and simple way to get your enemy following your player in Unity!
Wanna get your hands on the code? Support me on PATREON! / jakemakesgames
Follow me on TWITTER: / jakemakesgames
Music in this video: • [FREE] Lo-fi type beat...
(no copyright is intended by using this music, all rights go to their respective creators).
Пікірлер: 49
Woooo, perfect. 👍
@JakeMakesGames
4 күн бұрын
Glad you enjoyed!
You deserve 10x more views. Great channel you have!
@JakeMakesGames
Жыл бұрын
Thank you so much! I really appreciate it!
Nice! Just making me realize how simple and cool a lot of this stuff can be. It reminds me a lot of an old XBOX LIVE Arcade game from the 360 called "i maed a gam3 w1th z0mb1es 1n it" with how similar the AI movement mechanics function. Still has one of the best OSTs to this day in my eyes... 😌 lol keep it up!
@JakeMakesGames
2 жыл бұрын
Simple and effective is the way to go until you need to make it more complex for sure! Haha thanks man!
Amazing Tutorial as always. If it wouldn't trouble you too much, I'd love to see you do a player melee and/or ranged attack tutorial.
@JakeMakesGames
Жыл бұрын
Can do! What sorta shooting would you like to see? Top down shooter, or platformer shooter?
@cactistudios8406
Жыл бұрын
@@JakeMakesGames I'd like to see a top-down shooter.
@jebthesheep_
Жыл бұрын
@@JakeMakesGames Top Down!!
Wow that was simple, i subscribe!!, Can you make other tutorial like how to make a jumpscare menu when the enemy got you, because i was making a horror 2D game
@JakeMakesGames
2 жыл бұрын
All you did to do, is when the player collided with the enemy set a canvas game object to true :)
Can you make a 2D movement tutorial? I want my game to have some sort of momentum or sense of realistic speed like in Mario or Sonic
@JakeMakesGames
Жыл бұрын
I’ll have a play around in unity and see what I can come up with
is there any way i can add wall collision to the enemies when i just add a collider the fly through the wall and the wall have colliders
@JakeMakesGames
Жыл бұрын
yeah! add 2D box colliders to the walls, then a 2D collider to the enemy and give it a 2D rigidbody (make sure to set the gravity scale to 0 so its not effected by gravity). that should do the trick
@GravitraxMasters69
9 ай бұрын
Thank you@@JakeMakesGames
Out of curiosity, is Time.deltaTime put to make sure the AI is not always fixed on the player's position?
@JakeMakesGames
4 ай бұрын
Time.deltaTime pretty much stores time between the last frame to the current one, and ensures that everything runs the exact same on every machine, even if they have different FPS and refresh rate capabilities
Can you do a tutorial on how to make a player shoot in a top down shooter
@JakeMakesGames
Жыл бұрын
Sure!
I have a question how can you make it so that if an object is in front of it, like a wall, cannot follow the player anymore and just goes somewhere random
@JakeMakesGames
11 ай бұрын
You’ll probably need to use raycasting to detect when there’s a wall in the way and change the enemy behaviour depending on that
@Pyche-.-.-
11 ай бұрын
Okay
@Pyche-.-.-
11 ай бұрын
Hey also do you have any tips on how to make it if you are to far away it will stop following you
Tried to support you on patreon but it says your account isnt set up for that
@JakeMakesGames
2 ай бұрын
I appreciate that, unfortunately when I had my patreon set up I didn’t really have the time to put into it so I shut it down, hopefully I’ll be able to work towards trying again soon!
@JakeMakesGames
2 ай бұрын
I appreciate that, unfortunately when I had my patreon set up I didn’t really have the time to put into it so I shut it down, hopefully I’ll be able to work towards trying again soon!
@UptownFade666
2 ай бұрын
@@JakeMakesGames Hey quick Question: How would I modify this script to make the enemy rotate to face me as he chases. Right now he just chases but wont face me. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Enemyfollow : MonoBehaviour { public float speed = 1.0f; public Transform target; // Update is called once per frame void Update() { transform.position = Vector3.MoveTowards(transform.position, target.position, speed * Time.deltaTime); } }
Can you do a top down shooting one pls
@JakeMakesGames
2 жыл бұрын
I was thinking about doing a top down shooter series!
@Wh3nzs
2 жыл бұрын
@@JakeMakesGames cool
as soon as i click play my console keeps saying Object reference not set to an instance of an object. and then the file name. Can you please help since i am a starter and dont understand this???
@JakeMakesGames
Жыл бұрын
im going to need more details? what object reference is not set?
@superspud678
Жыл бұрын
Have the exact same problem the error says. “NullReferenceExceptiom: Object reference not set to an instance of an object EnemyFollow.Start() (at Assets/EnemyFollow.cs:13)
@JakeMakesGames
Жыл бұрын
@@superspud678 sounds like the issue is coming from your start method, what code do you have there?
@superspud678
Жыл бұрын
@@JakeMakesGames target = GameObject.FindGameObjectWithTag("Player").GetComponent();
@JakeMakesGames
Жыл бұрын
@@superspud678 make sure the player has the "Player" tag assigned to it
i did the tutorial but the enemy just flies away when i bump into it and stops following me any tips?
@JakeMakesGames
11 ай бұрын
If your player/ enemies have rigidbodys and colliders ensure that the colliders are triggers as it may be the rigidbodys are clashing
@CapyDude._.
11 ай бұрын
@@JakeMakesGames wow i didn't even think of that thanks I'll try it out
@JakeMakesGames
11 ай бұрын
No worries!
@CapyDude._.
11 ай бұрын
Can you make a platformer level editor guide and saving the levels If you can maybe even cloud saving
@JakeMakesGames
11 ай бұрын
Probably not, sorry
Now make Inventory System in 1 minute
@JakeMakesGames
2 жыл бұрын
Wouldn’t mind making a tutorial on an inventory system but I doubt it’s doable in 1 minute 🥴