How to Make Pickup Items with OnTriggerEnter2D in Unity
Chris' Tutorials
Shows you how to make an item game object that can be picked up when the player walks into it's Trigger collider area and run a function on the player's inventory. In this tutorial, I setup the inventory with an interface so that you can create different types of inventories that can all work with the pickup object.
MoneyPickup https://pastebin.com/Vxi3PpH9 IInventory https://pastebin.com/YYqHxbA6 PlayerInventory https://pastebin.com/GwM83jKr
◢◤◣◥ My Latest Unity 2D GameDev Course ◢◤◣◥ Make a 2D Platformer Character with State Machines in Unity 2020 https://skl.sh/3lpWPQL
◢◤◣◥ Chris Recommends ◢◤◣◥ Skillshare for Online Video Courses ►► https://www.skillshare.com/r/user/christutorials ProtonVPN for Internet Privacy ►►https://go.getproton.me/SHDO
◢◤◣◥ See My Full Software Courses ◢◤◣◥ http://christutorials.teachable.com https://www.udemy.com/user/chris-navarre/ https://www.skillshare.com/r/user/christutorials
➣ Follow Me On YouTube ►►https://www.youtube.com/user/darkskeletontuts Odysee ►► https://odysee.com/$/invite/@ChrisTutorials:b Bitchute ►►https://www.bitchute.com/channel/hU2elaB5u3kB/ Pocketnet ►► https://pocketnet.app/christutorials Minds ►►https://www.minds.com/register?referrer=ChrisTutorials Gab.ai ►► https://gab.ai/ChrisTutorials
00:00 - What to Expect 00:12 - Creating a Pickup Prefab 01:32 - MoneyPickup Script 03:03 - Player Inventory 03:58 - Inventory Interface 05:02 - Implement IInventory 06:05 - Set Inventory Money Value in Money Pickup 08:17 - Coin Prefab 08:58 - Testing Pickups 10:09 - Wrapup ... https://www.youtube.com/watch?v=BO9E723Jiqs
28434160 Bytes