Uploaded January 2022 | Updated September 2026, 2 weeks ago
PSA: The "Unit" class is a simple class I created to represent a unit in my game. It's NOT an inbuilt class. Sorry for the confusion.
As a new dev, keeping references to game objects you need can be a little confusing. Learn how to store game objects for later use as well as allowing external scripts access to your goodies.
Instead of trying to find an object, shift your thought pattern a little and ask "should I already know where this object is?".
❤️ Become a Tarobro on Patreon: patreon.com/tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: discord.gg/tarodev
✅ MORE TUTORIALS: youtube.com/tarodev
0:50 - Find Methods
1:45 - GameObject from Instantiate
2:33 - Component from Instantiate
3:49 - Multiple Components
4:59 - Static Instance
5:42 - Public Access Modifier
8:08 - Constructors
9:20 - MonoBehaviour "Constructor" (Init)
11:00 - OnCollision
11:50 - TryGetComponent
12:41 - GetComponent
13:03 - SendMessage
13:35 - Closing
PSA: The "Unit" class is a simple class I created to represent a unit in my game. It's NOT an inbuilt class. Sorry for the confusion.
As a new dev, keeping references to game objects you need can be a little confusing. Learn how to store game objects for later use as well as allowing external scripts access to your goodies.
Instead of trying to find an object, shift your thought pattern a little and ask "should I already know where this object is?".
❤️ Become a Tarobro on Patreon: patreon.com/tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: discord.gg/tarodev
✅ MORE TUTORIALS: youtube.com/tarodev
0:50 - Find Methods
1:45 - GameObject from Instantiate
2:33 - Component from Instantiate
3:49 - Multiple Components
4:59 - Static Instance
5:42 - Public Access Modifier
8:08 - Constructors
9:20 - MonoBehaviour "Constructor" (Init)
11:00 - OnCollision
11:50 - TryGetComponent
12:41 - GetComponent
13:03 - SendMessage
13:35 - Closing






![2D follow AI with Unity - [Tutorial]
In this video, Ill show you how to create an enemy which will follow your player. It uses an adjustable rotation speed to give you greater control over the enemys accuracy.
❤️ Become a Tarobro on Patreon: https://www.patreon.com/tarodev
🔔 SUBSCRIBE: https://bit.ly/3eqG1Z6
🗨️ DISCORD: https://discord.gg/tarodev
✅ MORE TUTORIALS: https://www.youtube.com/tarodev
MORE TUTORIALS:
https://www.youtube.com/c/Tarodev
0:00 Intro
0:38 Setting the follow target
1:15 Simple following
2:55 Adding rotation speed for realism
4:36 Moving towards our rotation direction 2D follow AI with Unity - [Tutorial]](https://i.ytimg.com/vi/jlklOd8PEQE/mqdefault.jpg)



