Тёмный

Learn INTERFACES in 5 minutes | Unity 

Root Games
Подписаться 3,8 тыс.
Просмотров 4,4 тыс.
50% 1

Learn how to use interfaces in this quick Unity tutorial.
In this example, we will use the IInteractable interface to interact with any object that implements that interface.
✅ Get my courses with discount:
👉 Unity 2D Master: www.udemy.com/...
👉 Unity Mobile Course: www.udemy.com/...
👉 Unity Input System with Rebinding: www.udemy.com/...
👍 Save your time and learn Unity faster
-------------------------------------------------------
🔔 Subscribe for more awesome content:
🔴 / @rootgames
-------------------------------------------------------
🟡 Support this channel through donations
Any amount means a lot and will help grow the channel:
👉 PayPal: www.paypal.com...
-------------------------------------------------------
Social Networks:
⭐ Instagram: / rootgamesofficial
⭐ Twitter: / rootgamescro
⭐ TikTok: www.tiktok.com...
⭐ Facebook: / root-games-10337038860...
-------------------------------------------------------
#unity #interface #interfaces #unitytutorial

Опубликовано:

 

27 июн 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@PoisonedAl
@PoisonedAl Год назад
Once you learn Interfaces and Events, life gets a lot simpler and your code WAY cleaner. Get scriptable objects in there too and you can remove a lot of your dependencies.
@RootGames
@RootGames Год назад
True facts 👍🏻
@markorossie9296
@markorossie9296 Год назад
Please that sounds very useful. Please consider make a tut of how. Thanks
@FyresGames
@FyresGames 9 месяцев назад
Totally agree. I use SO as middle man for my events and it work great!
@ThanhNguyen-gj1pm
@ThanhNguyen-gj1pm 11 месяцев назад
I went through your tutorials and it was so helpful that I decided to buy your course to support you.
@RootGames
@RootGames 11 месяцев назад
Thank you very much! I really appreciate it ❤️
@Soundy777
@Soundy777 11 месяцев назад
Straight to the point, concise & informative! Brilliant explanation!!
@RootGames
@RootGames 11 месяцев назад
Thank you! 😉
@motero2k
@motero2k Год назад
I really like your videos. This video is short but very useful. Awesome!
@RootGames
@RootGames Год назад
Thank you! Glad you like them, more to come!
@gamesbyspinola
@gamesbyspinola Год назад
really cool !! Very useful ! Thanks
@RootGames
@RootGames Год назад
Thanks Spinola!
@FyresGames
@FyresGames 9 месяцев назад
It is indeed a way to do it, but what about going the other way around? You could put the OnTriggerEnter and Exit only once onto the player. When its in range of a trigger, set a bool _canInteract to true and _interactable = other.GetComponent(); (Set back to false and null in exit).
@RootGames
@RootGames 9 месяцев назад
Yes you also do it like that. Just note that then you lose some flexibility, because your collider for detecting interactables is always the same (on the player). In the way shown in the video, you can customize the colliders for each object as you wish/need.
@FyresGames
@FyresGames 9 месяцев назад
@@RootGames Oh no forgot to say the collider trigger is still on the objects. The main difference is instead of each objects getting the player component and sending their IInteractable to the player, the player get it itself.
@stbnsnt
@stbnsnt 7 месяцев назад
Good! But it’s better to place OnTrigger event inside player
@RootGames
@RootGames 7 месяцев назад
Yes, you also do that! 😉
@richardrothkugel8131
@richardrothkugel8131 6 месяцев назад
ISubscribe. You got me.
@NoobProMaster01
@NoobProMaster01 Год назад
Can you make a tutorial for ground enemy chase trigger?
@RootGames
@RootGames Год назад
I'm in the middle of creating a new course. Did you watch my flying enemy tutorial? It may give you an idea of how to do it.
@zeusdelolimpo2882
@zeusdelolimpo2882 Год назад
quee bien
@RootGames
@RootGames Год назад
Thank you! 😉
@user-yu1hg8ql1t
@user-yu1hg8ql1t Год назад
why doesn't my vs code report an error when not implementing the interface? should I type it down for each class?🥲
@dbrikashabukshan8673
@dbrikashabukshan8673 18 дней назад
Yes, but you could very easily create a template script to copy-paste and edit as needed
Далее
Fix Visual Studio Autocomplete in Unity
1:25
Просмотров 3,3 тыс.
Interface Damage
11:15
Просмотров 13 тыс.
My Game Dev Workflow & Tools in 2024
6:14
Просмотров 154 тыс.
Events & Delegates in Unity
13:20
Просмотров 54 тыс.
20 Advanced Coding Tips For Big Unity Projects
22:23
Просмотров 175 тыс.
Unity's NEW input system in 13 minutes
13:02
Просмотров 17 тыс.