Hey, if someone wants to make the speed fixed regardless of the distance to the player, just set mousePosition.z to 0 before calculating shootDirection
@pedromaganin2519Күн бұрын
Thanks for this video! Im so excited for this top down series 🎉🎉
@GameCodeLibraryКүн бұрын
You're welcome!! The episodes should get more and more exciting as they go along :-)
@GiangNguyen-ho5stКүн бұрын
I usually use GetAxisRaw to get instantaneous movement without acceleration or deceleration, does the new input system have an equivalent approach?
@GameCodeLibraryКүн бұрын
The context.ReadValue<Vector2>(); should give you the current value of the input axis without any smoothing, so it should be the same behavior of GetAxisRaw!
@thisguymartin2 күн бұрын
Another fire video. That ending music just bring nostalgia. Keep at it!
@GameCodeLibrary2 күн бұрын
Thank you!! The end music is cozy right! It's from a pokemon mystery dungeon game - which I've only played one of way back when I was young haha! Just found it when looking for a new theme to use online :-)
@PixelPulseGaming-bt4zg2 күн бұрын
Would you kindly make as video about all the things we tick or untick that how it effect our animation?
@PixelPulseGaming-bt4zg2 күн бұрын
btw thanks for the tutorials
@TomDytorn2 күн бұрын
finally a recent video that works T_T
@eshaanb23623 күн бұрын
Thanks for the tutorial, it really helped!
@GameCodeLibrary2 күн бұрын
You're welcome, I'm glad it helped!!
@PixelPulseGaming-bt4zg3 күн бұрын
Nice onee
@diegogb19993 күн бұрын
how do i go down from the platform pressing down key or s?
@GameCodeLibrary2 күн бұрын
I have another video showing this! :-) kzbin.info/www/bejne/l4jHqISAl8xketU
@betanpc82104 күн бұрын
your videos are helpful thank you
@GameCodeLibrary4 күн бұрын
I'm glad they can help!! :-)
@amigoscrippigamer56276 күн бұрын
Greetings from Venezuela, my queen, well, I don't know much English and I'm just learning to program and I want to tell you that I love all your videos, even though I don't understand almost anything because I don't understand English well, but that doesn't stop me from following in your footsteps, I love you and I will be your faithful follower until the end :3
@GameCodeLibrary4 күн бұрын
Thank you I'm glad you enjoy my videos!! Sorry they're all in English :p Hopefully the auto-subtitles can translate some of it too! :-)
@amigoscrippigamer56273 күн бұрын
@@GameCodeLibrary I am a simple subscriber who has fallen in love with you although I do not understand English perfectly, I love you, and I am going to dedicate a poem to you
@amigoscrippigamer56273 күн бұрын
@@GameCodeLibrary In the world of code, she shines like a star, A creator of content, she's taken me far. With her tutorials, I've learned so much, Her passion and knowledge, they're a powerful crutch. I love her for the way she simplifies, Complex concepts, making them easy on the eyes. Her patience and dedication, they know no end, She's my programming mentor, my dear friend. So here's to the creator who lights up my screen, Whose videos and posts, I hold in high esteem. I'll forever be grateful for all that she does, For inspiring me to code, just because.
@amigoscrippigamer56276 күн бұрын
I love you
@kadaad44626 күн бұрын
Thank you for the video, but please turn on dark mode.
@GameCodeLibrary5 күн бұрын
I work during the day in a bright room so dark mode would strain my eyes! Dark mode can also be difficult for some people to read, so I’ll never switch my IDE. Sorry if you program in the dark! You can change your theme. :-)
@ThePaulineu7 күн бұрын
This is such a cool thing to do! Thank you for keeping it bite sized as well :)
@GameCodeLibrary7 күн бұрын
I'm glad you like the idea!!! I'll do my best to make it as good as possible for us all 🥳
@adrianguerequedelagarza48977 күн бұрын
Amazing video!!
@GameCodeLibrary7 күн бұрын
I'm glad you enjoyed!! :-)
@elderado8 күн бұрын
I needed this, Thanks 👍
@GameCodeLibrary8 күн бұрын
You're welcome!!! I'll try make it the best possible for us! :-)
@mattrobb35668 күн бұрын
Looks like it will be great. In fact I just went Woo Yeah! Creating a base which can be used to address a range of top down games is a cool idea. I think this may call for Patreon support! Also you deserve to have many more subscribers.
@GameCodeLibrary8 күн бұрын
I'm glad you like the idea!! I'll try make it a good base for us to all work off of! :-)
@mcfeybros10168 күн бұрын
Thank you! <3
@GameCodeLibrary8 күн бұрын
You’re welcome!! I’ll work hard to make this the best it can be for us 💪
@inhokim14948 күн бұрын
Feeling like I have a colleague going through this tough task together!
@GameCodeLibrary8 күн бұрын
We’re a team! 💪
@LlamaDaisy9 күн бұрын
I'm so excited for this!
@GameCodeLibrary8 күн бұрын
I’ll do my best to make it as good as possible for us!! 🙏
@ukickedmyd0g9 күн бұрын
I loved your 2d platformer playlist. I'm just dabbling in game dev, but I've been wanting to try a top down game. Excited for future videos :D
@GameCodeLibrary8 күн бұрын
So glad you enjoyed the platformer series!! Hopefully this one will be even better 😈
@rvargas09729 күн бұрын
Hmmm GCL, maybe do you know how to handle the slopes, for a 2D platformer. Like, how do yo do to keep stick to the slopes platform? 😅
@GameCodeLibrary9 күн бұрын
Maybe I’ll do a video in the future!! I’m sure there’s vids out there on how to do it :p
@rvargas09729 күн бұрын
Cool! I'm really excited as much as you. Congrats for this new serie. Love it, thank you so much!
@GameCodeLibrary9 күн бұрын
I’m glad!! 😌🙏
@scarfecksdee6459 күн бұрын
Woo, yea, great idea!
@GameCodeLibrary9 күн бұрын
Just as I imagined 😌
@fabian_ftn66049 күн бұрын
You definitely need more views, underrated. Keep it upp!!
@GameCodeLibrary9 күн бұрын
Haha thank you!! As long as I can help even one person make their dream game easier - I'm happy!! :-) And more views would be cool... I'll keep going!! Thank you for your support :p
@thatAsainChink9 күн бұрын
Lets go !!!!
@panD3MONiumGames-on9mt9 күн бұрын
Looking forward to this series!
@GameCodeLibrary9 күн бұрын
I'm so glad!! I'll try my best to make it good for all of us :-)
@jost_ming61319 күн бұрын
Finishing up the 2D scroller videos, cannot wait to follow through these ones too!!
@GameCodeLibrary9 күн бұрын
I'm glad you're enjoying them!! I'll work hard to get this top down series the best it can be!
@davitheking0249 күн бұрын
that's so nice. i'm still looking for tutorials on action rpg roguelikes, but this will for sure be useful everywhere for every genre. looking forward to it
@GameCodeLibrary9 күн бұрын
Right there are so many shared features between games - so I'll try my best to get this template right so we can use it for any future games! Will be handy for us all! :p I'll like to try do a roguelike series in the future too!! I've written a random upgrade system before, but I'm sure I can make something better :-) Thanks for your supoort!
@GiangNguyen-ho5st9 күн бұрын
It's always my dream to make a top down game like a old zelda or pokemon game, looking forward to this series
@GameCodeLibrary9 күн бұрын
Yesss!! This first base template should give you all the main features you need to then go and create both a game like zelda AND a game like pokemon!! I plan on doing this base template series and then using it to first make a zelda-like series, so an action combat rpg!
@GiangNguyen-ho5st9 күн бұрын
@@GameCodeLibrary Sounds good. I did make a survivor top down game demo a few months ago (feel free to have a look at my channel 😉). Hope I can build upon it with your tutorials.
@thisguymartin9 күн бұрын
TY 🙏 This is what I am making and it is a mix of this and Metroidvania. You are a life saver 🛟
@GameCodeLibrary9 күн бұрын
Hopefully I can make some videos that help out with your game!! :-)
@_justcoding_11 күн бұрын
I thought your tutorial was well spoken and easy to follow. I was able to add 2D URP lighting to my already existing project so thank you!
@GameCodeLibrary11 күн бұрын
Yay I’m so glad it worked for you!! :-) have fun good luck with your project!
@_justcoding_11 күн бұрын
Thanks, I thought your tutorial was well paced and easy to understand, helped me a lot getting started with 2D URP for my existing project
@fabian_ftn660412 күн бұрын
Hello, You don't have a discord server? I tried Joining with the link but seems link is dead
@GameCodeLibrary12 күн бұрын
Ahh yeah it was there but it seems to have vanished!! I'll have to make a new one and update all the descriptions when I have time some day 🥲
@JJJTHE3RD13 күн бұрын
I'm not sure what went wrong I followed the video exactly and now my player moves but his body swaps the the other direction (i.e. if they are moving to the left their body will be facing right etc)
@GameCodeLibrary13 күн бұрын
You default sprite must have been the opposite to mine! In your sprite renderer you can tick the 'flip X' option and it'll be an easy fix :p
@seanitbcostelloecacho13 күн бұрын
My enemy doesn't detect the ground in front. All the other things work perfect, however, this one no.
@accessplayerYT14 күн бұрын
It was great thanks. But my characters not rotating when I turn what soupd I do
@GameCodeLibrary14 күн бұрын
This is a simple movement script: public class PlayerMovement : MonoBehaviour { float horizontalInput; float moveSpeed = 5f; Rigidbody2D rb; SpriteRenderer spriteRenderer; void Start() { rb = GetComponent<Rigidbody2D>(); spriteRenderer = GetComponent<SpriteRenderer>(); } private void FixedUpdate() { horizontalInput = Input.GetAxis("Horizontal"); spriteRenderer.flipX = horizontalInput > 0; rb.velocity = new Vector2(horizontalInput * moveSpeed, rb.velocity.y); } } This bit in FixedUpdate flips the sprite: spriteRenderer.flipX = horizontalInput > 0; You can do it like that, or! Follow along at the timestamp I've linked in this video - which is the previous video of this one :-) kzbin.info/www/bejne/porYZGmGgdKXp5I
@makoa31614 күн бұрын
how can i flip the animation? like when he walk to the right or tho the left? tanks for the video
@GameCodeLibrary14 күн бұрын
This is a simple movement script: public class PlayerMovement : MonoBehaviour { float horizontalInput; float moveSpeed = 5f; Rigidbody2D rb; SpriteRenderer spriteRenderer; void Start() { rb = GetComponent<Rigidbody2D>(); spriteRenderer = GetComponent<SpriteRenderer>(); } private void FixedUpdate() { horizontalInput = Input.GetAxis("Horizontal"); spriteRenderer.flipX = horizontalInput > 0; rb.velocity = new Vector2(horizontalInput * moveSpeed, rb.velocity.y); } } This bit in FixedUpdate flips the sprite: spriteRenderer.flipX = horizontalInput > 0; You can do it like that, or! Follow along at the timestamp I've linked in this video - which is the previous video of this one :-) kzbin.info/www/bejne/porYZGmGgdKXp5I
@Atom-Mercury15 күн бұрын
Great tutorial. My hold to load image was working until but now it’s not. I’ve replayed that part again but can’t seem to find what’s the issue.
@Atom-Mercury15 күн бұрын
Meaning, when I press "e" on the keyboard and my progression bar has reached it maximum, it doesn't show the image nor does it load the next level. I've unchecked level 2 and the canvas and checked level 1.
@Atom-Mercury15 күн бұрын
So Sorry, it actually worked. I had gem count that had to reach 20 in order to be able to move to the next level. Thank you kindly.
@GameCodeLibrary15 күн бұрын
So glad you found the issue! I saw the notification for your comment and started trying to think of what the problem could be - phew! Well done debugging and fixing it!
@Atom-Mercury15 күн бұрын
@@GameCodeLibrary Thank you so much. I have to thank you for your videos. I just finished a Unity Game Dev course at college (Canadian college) and I managed to pass it thanks to you. I learned so many things that helped on my final project. Thanks again.
@GameCodeLibrary14 күн бұрын
@@Atom-Mercury Amazing I'm so glad I could help!! Helping you learn in the easiest way possible is the sole reason I do this!! 🤩 Makes me so happy to hear I could help! And congrats on passing - I'm sure you'll continue to do great!
@cerritosrules15 күн бұрын
Wouldn't creating a new enemy object if all 10 enemy objects are active lag the game? That means it will endlessly spawn enemies with no limit?
@GameCodeLibrary15 күн бұрын
That depends on your spawning code! You can set a limit on the spawner. The object pool stays generic so can have unlimited creations or a limited amount, depending on how you use it! This keeps the object pool script generic and reusable for all features.
@cerritosrules15 күн бұрын
@@GameCodeLibrary I see that makes sense. I think I need to apply this to items that drop from my enemies too lol
@GameCodeLibrary15 күн бұрын
@@cerritosrules That's a good idea!! Really good use case to use it for item drops :o
@cerritosrules14 күн бұрын
@@GameCodeLibrary Do you plan on making more videos to improve performance for games? They are very helpful thank you!
@GameCodeLibrary14 күн бұрын
@@cerritosrules Yes I'd love to keep covering game performance improvements!! Everything I make I try to make modular and the best way possible (or at least the easiest way with best performance haha!) So hopefully I can continue that as well :-) Thanks for your kind words!! Means a lot!
@maciusbrawler948216 күн бұрын
🙂
@kristyven18 күн бұрын
love your videos <3
@GameCodeLibrary18 күн бұрын
Thank you I’m glad you like them 😌🙏
@kristyven18 күн бұрын
@@GameCodeLibrary yeah love the atmosphere u create :P btw do you have any free assets i could use for a project ?
@GameCodeLibrary18 күн бұрын
@@kristyven If you go to my Patreon you can filter it on 'Tier' and click 'Public' to see all the free things I have up! You can also find a lot of cool free assets on itch.io - I get a lot of stuff for my projects from there! 🙂 itch.io/game-assets/free
@kristyven18 күн бұрын
@@GameCodeLibrary really helpful thank youuu 😚
@Jacobs_mc19 күн бұрын
I got an error thats quote "Assets\PlayerMovment.cs(56,45): error CS1061: 'Vector2' does not contain a definition for 'Magnitude' and no accessible extension method 'Magnitude' accepting a first argument of type 'Vector2' could be found (are you missing a using directive or an assembly reference?)" and i dont know how to fix it. I have no coding experience and i put the anim.SetFloat("MoveMagnitude",input.Magnitude); like you did in your video but its giving me this error.
@GameCodeLibrary19 күн бұрын
Need to be a lowercase M on magnitude Code is case sensitive! :-)
@mattrobb356619 күн бұрын
Thanks another brilliant tutorial. Key takeaway was that the Object pool sizes can expand, a point often missed! Excellent delivery speed too, delivery was slightly slower than some of your other videos. I like that more.
@GameCodeLibrary19 күн бұрын
I’m glad you enjoyed!! I did try to slow down the pace a bit - while still keeping it stream line. Glad it worked well! I’ll try keep a smoother pace in future 🙏
@rvargas097221 күн бұрын
you're very smart, charismatic and lovely, I love your videos not in any bad way I mean. thank you so much for everything! :3
@GameCodeLibrary20 күн бұрын
Thank you!! :-) So glad you enjoy the videos! I'll keep working hard and try getting better and better at them too! Thanks again I appreciate your kind words a lot!
@GameCodeLibrary21 күн бұрын
You can grab this whole mini game package on itch.io for $2.99! Or on Patreon for £3 (Whichever is cheaper for you - taxes on itch.io can up the price for non-US 😱) gamecodelibrary.itch.io/mini-space-shooter-with-object-pooling www.patreon.com/GameCodeLibrary/shop/mini-space-shooter-with-object-pooling-204034?source=storefront Alternatively, you can support the channel and join our Patreon for £5 - gaining access to ALL code from ALL videos! www.patreon.com/GameCodeLibrary Either way - hope you enjoy! 😇🙏
@GiangNguyen-ho5st21 күн бұрын
I always forget to reset the state of the object pooled. Like if you enemies have HP or your bullets have lifetime, must remember to reset them OnEnable or OnDisable.
@GameCodeLibrary21 күн бұрын
Yes!! That is a tricky bit! Perhaps you can store your defaults and call a function that sets your object back to default before disabling and returning it to the pool 🤔 At least it's an easy fix :p