Simple Enemy Follow AI in ONE MINUTE in Unity!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial i'll show you a quick way to get an enemy following your player in unity i already have player movement set up and ready to go create a new script called enemy follow and open it up in your code editor [Music] create a private transform variable called target and a public float called speed in start set the target variable to the player's position in update set the enemy's position to the target position using vector2.move towards this works by moving an object towards a target and takes in a couple of parameters first the thing you want to move where you want it to go and how fast it'll get there back in unity create an enemy game object attach the enemy follow script to it and give it some sort of speed value also be sure to give your player game object the player tag otherwise this won't work [Music] and just like that you have an enemy following your player in unity if there are any other tutorials you want to see from me let me know in the comments below if you'd like to get your hands on the source code the project will be available on my patreon which i'll leave a link to in the description below but that's all for this video thanks for watching and i'll see you in the next one [Music]
Info
Channel: Jake Makes Games
Views: 7,493
Rating: undefined out of 5
Keywords: Unity, Unity Tutorials, Game Development
Id: 4zAN5QBwGt8
Channel Id: undefined
Length: 1min 8sec (68 seconds)
Published: Fri Jun 24 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.