- 66
- 242 335
Game Code Library
United Kingdom
เข้าร่วมเมื่อ 21 เม.ย. 2023
Tutorials for modular features and simple games. Add into your existing games, or create a new game together!
You can get access to all the code files used in these videos from my Patreon:
www.patreon.com/GameCodeLibrary
You can get access to all the code files used in these videos from my Patreon:
www.patreon.com/GameCodeLibrary
Inventory Slot Saving for Draggable Items - Top Down Unity 2D #9
Saving inventory states is a key feature for 2D games with drag-and-drop systems. In this video, we'll add saving functionality to our inventory, ensuring items stay in the correct slots even after closing the game!
We'll be using the menu and inventoy UI we made in these videos:
th-cam.com/video/liba3xGI4gM/w-d-xo.html
th-cam.com/video/wlBJ0yZOYfM/w-d-xo.html
And the saving base we made in this video:
th-cam.com/video/rDZztBWGMIs/w-d-xo.html
Code Files: www.patreon.com/posts/inventory-slot-117560971
Full Playlist: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html
Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack
All source code for all videos I have made and will make in the future can be found on my Patreon:
www.patreon.com/GameCodeLibrary
If you have any suggestions, feedback or questions, be sure to comment below! Any opinions will help me out on this journey ♡
Check out the full platformer playlist!
th-cam.com/play/PLaaFfzxy_80EWnrTHyUkkIy6mJrhwGYN0.html
BUY THE COMPLETE PLATFORMER GAME TEMPLATE NOW!!!
gamecodelibrary.itch.io/2d-platformer-template
www.patreon.com/GameCodeLibrary/shop
#unity #gamedev #gamedevelopment #unity2d #topdown
0:00 - Intro
0:30 - Prefabs Folder
0:45 - Item Script
1:36 - ItemDictionary
5:09 - InventorySaveData
5:57 - SaveData
6:19 - InventoryController
8:35 - What does GetSiblingIndex do?
9:15 - InventoryController (continued!)
12:05 - SaveController
13:20 - Initial Test
14:08 - MonoBehaviour Error Fix
14:55 - Script Execution Order
15:58 - Working Test!! :-)
16:14 - Save Data Location and JSON
16:58 - Next Video
17:14 - Outro
We'll be using the menu and inventoy UI we made in these videos:
th-cam.com/video/liba3xGI4gM/w-d-xo.html
th-cam.com/video/wlBJ0yZOYfM/w-d-xo.html
And the saving base we made in this video:
th-cam.com/video/rDZztBWGMIs/w-d-xo.html
Code Files: www.patreon.com/posts/inventory-slot-117560971
Full Playlist: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html
Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack
All source code for all videos I have made and will make in the future can be found on my Patreon:
www.patreon.com/GameCodeLibrary
If you have any suggestions, feedback or questions, be sure to comment below! Any opinions will help me out on this journey ♡
Check out the full platformer playlist!
th-cam.com/play/PLaaFfzxy_80EWnrTHyUkkIy6mJrhwGYN0.html
BUY THE COMPLETE PLATFORMER GAME TEMPLATE NOW!!!
gamecodelibrary.itch.io/2d-platformer-template
www.patreon.com/GameCodeLibrary/shop
#unity #gamedev #gamedevelopment #unity2d #topdown
0:00 - Intro
0:30 - Prefabs Folder
0:45 - Item Script
1:36 - ItemDictionary
5:09 - InventorySaveData
5:57 - SaveData
6:19 - InventoryController
8:35 - What does GetSiblingIndex do?
9:15 - InventoryController (continued!)
12:05 - SaveController
13:20 - Initial Test
14:08 - MonoBehaviour Error Fix
14:55 - Script Execution Order
15:58 - Working Test!! :-)
16:14 - Save Data Location and JSON
16:58 - Next Video
17:14 - Outro
มุมมอง: 381
วีดีโอ
Drag and Drop Inventory UI - Top Down Unity 2D #8
มุมมอง 1.2K2 หลายเดือนก่อน
FREE SCRIPT for our Drag Handler below :-) Drag and drop, expandable and simple inventory's are popular in 2D games. In this video we'll get the UI set up for our inventory! We'll be using the menu UI we made in this video: th-cam.com/video/liba3xGI4gM/w-d-xo.html FREE SCRIPT: www.patreon.com/posts/free-script-drag-113539544 Full Package and Code: www.patreon.com/posts/drag-and-drop-ui-11353924...
EASY Save and Load to JSON - Top Down Unity 2D #7
มุมมอง 1.1K3 หลายเดือนก่อน
You can save and load any data you need for your game to JSON with this easy script set! I use this method for all my Unity games - it's so clean, easy and simple! Like all the code we write ;-) We'll be adding a save button to our settings screen and loading on start of our game. Full Package: www.patreon.com/GameCodeLibrary Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Playl...
Menu with Tabs UI - Top Down Unity 2D #6
มุมมอง 1.3K3 หลายเดือนก่อน
Let's add the UI in for our games menu system and add tab functionality! We'll be able to add as many tabs as we like to the top and switch between the corresponding pages. Then we'll be ready for our inventory and settings that we'll add in future videos - as well as any others you may want to add! Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Package: www.patreon.com/posts/m...
Map Zone Transitions by Waypoints - Top Down Unity 2D #5
มุมมอง 1.1K3 หลายเดือนก่อน
When walking to the edge of our map, we'll set the map to move to the next area! We'll do this with adding collectible waypoints to our map grid so we can control all map movements. Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Package: www.patreon.com/posts/triggered-map-2d-110520888 Full Playlist: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html All source code for al...
Player Tracking and Camera Bounds - Top Down Unity 2D #4
มุมมอง 2K4 หลายเดือนก่อน
Let's get our camera following our player and also staying within the bounds we set! So the camera will follow our player until hitting the sides of our boundary collision and stop. Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Package: www.patreon.com/posts/player-tracking-109790549 Full Playlist: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html All source code for all...
PERFECT Tilemap Sorting Layers - Top Down Unity 2D #3
มุมมอง 5K5 หลายเดือนก่อน
Let's plan out the layers for our top down game! We'll be adding in: Walk in front, Collision, Walk behind, and more! We'll look at collisions on tilemaps and using sorting layers to give our game an amazing sense of depth! Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Old Rule Tile Vid: th-cam.com/video/8UctaO5DwUE/w-d-xo.html Full Package: www.patreon.com/posts/106861111?pr=true ...
Idle and Walking Player Animations - Top Down Unity 2D #2
มุมมอง 2.9K6 หลายเดือนก่อน
Using blend trees and the animation controller, this beginner friendly and full tutorial on Animations will give you everything you need! We'll set up our players idle and walking animations to get him moving in a FANCY way. Movement Video: th-cam.com/video/DQY62meLVCk/w-d-xo.html Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Package: www.patreon.com/posts/movement-with-2d-104...
Player Movement with Unity Input System - Top Down Unity 2D #1
มุมมอง 2.8K6 หลายเดือนก่อน
Beginner friendly and full tutorial on Player Movement using Unity's Input System! We'll also set up a default sprite for our player using the asset pack below. And look into serialized fields! Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Package: www.patreon.com/posts/movement-with-2d-104791237 Free Script: www.patreon.com/posts/free-script-with-104791310 Full Playlist: th-c...
Let's Make a Top Down Game! - Unity 2D #0
มุมมอง 4K6 หลายเดือนก่อน
Beginner friendly and any genre!! In this vid we'll plan out top down base template! And create our Unity project together. The idea will be to make this base template to then use and branch off to other game genres! Super exciting! Sprite sheet: pixel-boy.itch.io/ninja-adventure-asset-pack Full Playlist: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html All source code for all videos I h...
EASY Object Pooling - Unity Game Tutorial
มุมมอง 8717 หลายเดือนก่อน
EASY Object Pooling - Unity Game Tutorial
Complete Unity 2D Platformer Tutorial - Easy for Beginners 2024
มุมมอง 9K7 หลายเดือนก่อน
Complete Unity 2D Platformer Tutorial - Easy for Beginners 2024
Infinite Parallax Scrolling Background - Unity 2D Complete Tutorial
มุมมอง 12K8 หลายเดือนก่อน
Infinite Parallax Scrolling Background - Unity 2D Complete Tutorial
Add 2D Lighting to Existing Project - Unity 2D
มุมมอง 1.4K8 หลายเดือนก่อน
Add 2D Lighting to Existing Project - Unity 2D
Lighting in 2D Games! URP Template Overview - Unity 2D
มุมมอง 4748 หลายเดือนก่อน
Lighting in 2D Games! URP Template Overview - Unity 2D
Background Music Manager - 2D Platformer Unity #27
มุมมอง 5929 หลายเดือนก่อน
Background Music Manager - 2D Platformer Unity #27
Sound Effect Manager - 2D Platformer Unity #26
มุมมอง 66510 หลายเดือนก่อน
Sound Effect Manager - 2D Platformer Unity #26
Speed Boost Item - 2D Platformer Unity #25
มุมมอง 66810 หลายเดือนก่อน
Speed Boost Item - 2D Platformer Unity #25
Hidden / Secret Areas - 2D Platformer Unity #24
มุมมอง 66210 หลายเดือนก่อน
Hidden / Secret Areas - 2D Platformer Unity #24
Spike Traps and Bounce Traps - 2D Platformer Unity #23
มุมมอง 78810 หลายเดือนก่อน
Spike Traps and Bounce Traps - 2D Platformer Unity #23
Falling Platforms - 2D Platformer Unity #22
มุมมอง 67611 หลายเดือนก่อน
Falling Platforms - 2D Platformer Unity #22
Moving Platforms - 2D Platformer Unity #21
มุมมอง 1.5K11 หลายเดือนก่อน
Moving Platforms - 2D Platformer Unity #21
Drop Down Through Platforms - 2D Platformer Unity #20
มุมมอง 83411 หลายเดือนก่อน
Drop Down Through Platforms - 2D Platformer Unity #20
BEST WAY to Dash through Enemies - 2D Platformer Unity #19
มุมมอง 1.4K11 หลายเดือนก่อน
BEST WAY to Dash through Enemies - 2D Platformer Unity #19
Healing with Health Items - 2D Platformer Unity #18
มุมมอง 742ปีที่แล้ว
Healing with Health Items - 2D Platformer Unity #18
Enemy Drop Items on % - 2D Platformer Unity #17
มุมมอง 1.1Kปีที่แล้ว
Enemy Drop Items on % - 2D Platformer Unity #17
Player Aim at Mouse and Attack Enemy - 2D Platformer Unity #16
มุมมอง 967ปีที่แล้ว
Player Aim at Mouse and Attack Enemy - 2D Platformer Unity #16
Game Over Screen and Retry Button - 2D Platformer Unity #15
มุมมอง 1.4Kปีที่แล้ว
Game Over Screen and Retry Button - 2D Platformer Unity #15
Player Health and On Hit Effect - 2D Platformer Unity #14
มุมมอง 1.5Kปีที่แล้ว
Player Health and On Hit Effect - 2D Platformer Unity #14
I discovered your channel thanks to the sorting layer video. I really like your tutorials so far, hope you can continue making more in the future!
Download the full game template👾: gamecodelibrary.itch.io/2d-platformer-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Check out the playlist: th-cam.com/play/PLaaFfzxy_80EWnrTHyUkkIy6mJrhwGYN0.html Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
I am so great at making my own little mistakes it is forcing me to understand and rewatch your videos 5 times :D Appreciate your amazing guides!
Ahh sorry if I say anything too fast or confusing! ☺ Mistakes are the best way of learning though!! So glad you're enjoying 🥰
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
Check out the full tutorial playlist📋: th-cam.com/play/PLaaFfzxy_80HtVvBnpK_IjSC8_Y9AOhuP.html Download the Top Down Template🐸: gamecodelibrary.itch.io/top-down-2d-base-template Get all source code‼: www.patreon.com/c/GameCodeLibrary Enjoy!!
you are the goat! thanks
You're welcome!🫡
Nice! Glad to see you back!
Unity objects don't like those. No idea why.
This right here, this is a useful video. Now do something with =>
What language is this? C#?
Yep!
Is it gine if we do it with components? For example to check if we grabbed Rigidbody2D component of an object safely?
Yes!! I originally did this with a game object as the example 😝 but changed it so it’d work for any C# programmer. It works with any method call on something that could be null! So if you try to call a method from a rigid body. I’ll do another video on a shorten way for null value usage next 😊
@ Got it, will try it for sure. Thank you!! That’d be great✨
Love the syntax of this and the null coalesce. Worth nothing that this requires nullable toggled on
Great tutorial series so far! I'm using it as a springboard to get a basic setup for my own game, and it's been really helpful. While waiting for this upload, I've added a worldTime and a day/night cycle and a 'NPC' that randomly wanders around. My personal next challenge is to add both of these systems to the save system :) Thanks so much for all the work you put into these videos!
Yesss so glad you’re able to use it as a base to get your work going! Exactly what I was hoping 😌🙏 your additions sound so fun!!! Hopefully I’ve added enough to the saving that you can add in anything you need too - I believe! I’ll be adding a npc tutorial at some point too - but mine weren’t going to wander around, that’s such a cool idea! Day/night cycle is always so fun in every game… I want to use this base to make a farming sim template too some day and add that! Ahh so exciting hope your game goes well!
@GameCodeLibrary Your tutorial is honestly perfect! I love how modular everything is! Even if I might scrap certain functionalities later down the line, I'll probably keep them saved somewhere because they're just so easy to use. I post my progress on Bluesky (same name) if you want to have a look! Was actually surprised that I couldn't find you on that platform! Thanks again for all the time and effort!
guys someone still here? i need help why in my tilemap collider 2d does not appear "used by composite"?
Underrated
🫡🙏
Thank you :D
You're welcome :-)
with python, just replace the dollar sign, '$', with an 'f'
The video I was waiting for! Thanks!!!
You're welcome!! Hopefully you enjoy. I hate when my videos aren't modular and depend on the previous ones :p gets so confusing!!! Tried to keep it as simple as I could! 😇
woohoo! so glad you were able to get back to these! thank you..
You’re welcome!!! Working on the next one now so I’ll try keeping it more consistent 🫡
Finally! I've been waiting for Months!
😝 sorry I got so busy at work! 🙏 I’ll try be more consistent!!
What can i do? My player have a height of 2 tiles. If i go behind a tree with a lets say 6 tiles height i just cant sorting the bottem tile wiith the colloder part. How can i solting the second tile, the tile with the tree trunk?
I am really grateful about finding your channel for the JRPG i am making since i don`t know a whole lot about coding and Jrpgs tutorials are extremely scarse. I hope my project goes well with the help of your tutorials and you have my wholeheartedly gratitude for these videos.
You’re welcome!!! This first tutorial series will be a base for any top down game - but originally was going to be just for a turn based rpg game 🙀! So it should work well for a base for your game 😇 Once the base is done I’m going to branch into the other genres using this template, so will get back to a turn based rpg at some point!! You’ll probably be ahead of me by then though 😉 good luck!
I love your “doing one thing multiple ways and which is the better one” type of content, they are very helpful🙏🏻
I'm glad you like them!! :-) I'll try doing some more shorts with handy tips whenever I come across them in our code. There's always lots of options when it comes to programming - so fun!
@ Awesome, looking forward to it!🎉
So clear and so fun to watch.. I LOVE IT!!!
So glad you enjoyed!!! 🥳🥳
The award for most underrated channel goes to.... YOU! Wow, great content! I look forward to watching your channel hit it big real soon :)
:') Thank you - I'll keep working hard to get good vids out for you!
im in the thick of it
Player will stucked inside of the platform if character jump just inside of the platform
underrated channel
🙏❣
no matter how much i change the scaleof my gem whenever i load the game theyre like tiny dust particles and i can barely see them. someone help me
for some reason my camera is all jittery now and my confiner is not working anymore..
if some also experiences, try changing ur lens ortho size to something like 5, that was my fix for some reason
God I hate learning game development why does it have to be so complex even at simple things
cool video btw Your voice tone is so chilling
Game dev is the hardest form of programming! So many moving parts. Some game engines do a lot of the legwork for you, like gamemaker! If you don’t enjoy code and want to make 2D games you could check that out!!
@@GameCodeLibrary I am actualy okey with coding but I hate googling everything it breaks my motivation I want to make something on my own sadly I cant
I keep getting error code CS0120 for my loadgame SaveData.playerPosition, do you know how to fix that? Everything else works just fine! Also thank you for your tutorials!
Most straightforward help i've gotten for this, thank you so much😭🙏
So glad you enjoyed and to have helped 🙏
hey im back T-T after following the instructions from the console on unity i have arrived at the current code(they want me to add a whole bunch of semicolone but then when i do that it gives me like 10 errors saying that this context isnt given: private void Flip() { if (isFacingRight && horizontalMovement < 0 || !isFacingRight && horizontalMovement > 0) { isFacingRight = !isFacingRight; Vector3 ;1;s = transform.localScale; 1;s.x *= -1f; transform.localScale = 1;s; } }
my fellow learners i have arrived at a solution, i think c# for unity has a specific naming system so it has to be "scale.x" not "1s.x" hope this helps you all!: private void Flip() { if (isFacingRight && horizontalMovement < 0 || !isFacingRight && horizontalMovement > 0) { isFacingRight = !isFacingRight; Vector3 scale = transform.localScale; scale.x *= -1f; transform.localScale = scale; } }
i can’t figure out why my character can’t “light tap jump” i did a debugging log and only my “if (context.performed)” was sending messages. i never got a log for “else if (context.canceled)”
oh for some context. this morning before school i did some work on my project and i was able to get it working but ever since i finished that section of the video and worked on the other parts (double jump) it stopped working for some reason
i love your organization with the scripts!!