Unity Top Down Colliders and Character Movement - Tutorial

Поделиться
HTML-код
  • Опубликовано: 19 янв 2025

Комментарии • 160

  • @CouchFerretmakesGames
    @CouchFerretmakesGames  5 лет назад +12

    *Hey everyone!* 👏 👏
    I'm happy to announce our community *Discord server* , come and *join us* : discord.gg/dac7sr2
    And also, you can get all the *Sprites* and *Project Files* by supporting me on *Patreon* : www.patreon.com/CouchFerret

  • @albingrahn5576
    @albingrahn5576 6 лет назад +76

    I love the pixel drawings that explain things!

  • @jacktjong1266
    @jacktjong1266 5 лет назад +4

    Just wow. I've searched land and sea for a way to create sturdy colliders that do not rely on overlapping to create a solid border and never have I ever found the words "composite collider" anywhere. This changes my entire game plan. Thanks for the tutorial.

  • @Kapteeni40
    @Kapteeni40 4 месяца назад

    This is the best movement + collision tutorial on RUclips, I swear! It has examples, illuminating art; everything!

  • @mayankkela8485
    @mayankkela8485 5 лет назад +16

    CouchFerret you are a professional Developer who simply work
    And couch easily
    You are a nice Developer

  • @CulturalToast
    @CulturalToast 5 лет назад +9

    Love your "webcam" and new style of explaining

  • @TheAncester
    @TheAncester 6 лет назад +7

    Nice new addition with the 8bit ferret and accommodating description visuals man!

  • @basedbartholomew3968
    @basedbartholomew3968 5 лет назад +35

    My Opinion: These 2d Top Down Games Are One of The Best Styles. I don't Know Why So Many People Hate it

  • @kodo777
    @kodo777 6 лет назад +31

    Dude, you only have 1.5k subs???
    The quality of your vids equate to more!

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +7

      It's 1.6k now! :D Thanks man! I think I'm growing in a healthy manner. :)

  • @rickygr97
    @rickygr97 3 года назад +2

    i think this is one of the best explanations there is on youtube for explaining colliders thank you

  • @aryaiskandarsyah
    @aryaiskandarsyah 6 лет назад +44

    thank you so much, your channel is beginner friendly :D. and you did alot of edit on your character on the screen.
    this channel must become popular like brackeys :D

  • @BrandonMerrington
    @BrandonMerrington 2 месяца назад

    Sometimes its the simple things that cause the biggest issues. My player rotation not being constrained was making my player drift on collision. Thank you for the help.

  • @phi6669
    @phi6669 5 лет назад +2

    thx man, I sat in my chair almost with tears in my fckn eyes cause I have to show my Project to my teacher in a few days and i was so done with my life lol

  • @BenanaBoy
    @BenanaBoy 4 года назад +1

    Seriously underrated channel

  • @xkondi5434
    @xkondi5434 6 лет назад +2

    You put your heart into your videos, because of that it feels awesome to watch them and learn from them too :)

  • @dani1996dani
    @dani1996dani 5 лет назад +4

    I struggled with jittery movement even after using a physics calculation on the rigidBody of the player for hours - watched this video and I finally realized I needed to use a CIRCLE collider instead of a BOX collider for the player.
    Thanks for the video, its a good one :)

  • @hulm
    @hulm 6 лет назад +2

    Man, I am just happy for finding this channel 😃

  • @BulkyDookieVODS
    @BulkyDookieVODS Год назад

    This Video Saved Me!!!
    I've been trying to figure out how to collide a "Character" to other GameObjects using a Non-Physics "Transform" method in script. I didn't know you could use RigidBody2D like this LMAO!!!!!

  • @nivmiz0
    @nivmiz0 4 года назад

    THANK YOU SO MUCH! The phantom vertices were annoying me in my game, so I watched this and it's completely fixed now!

  • @ldvata7609
    @ldvata7609 11 месяцев назад +1

    Earned a sub

  • @alizaidi5610
    @alizaidi5610 4 года назад

    Severely under rated channel. Keep up the great videos.

  • @jemma.maurice
    @jemma.maurice 5 лет назад +1

    This ain’t quality content
    This is high quality content

  • @tiger_serzh
    @tiger_serzh 3 года назад

    Hello from Russia!
    And thanks for your lessons!

  • @hauntedcrowdev
    @hauntedcrowdev 10 месяцев назад

    I was struggling a bit with this! Thanks for this guide!

  • @ethanchien2511
    @ethanchien2511 5 лет назад +1

    Love your channel! So helpful for beginners like us! Thank you so much for uploading!

  • @viz.9649
    @viz.9649 2 года назад

    Thanks for the clean tutorial, man. Saved my future

  • @YeastyPasta
    @YeastyPasta 5 лет назад

    dude this was EXACTLY what i needed for my project thank you so much

  • @TheIslandIdiot
    @TheIslandIdiot 5 лет назад

    you deserve more subscribers and views! this is great!

  • @JoaoAntonioCardoso
    @JoaoAntonioCardoso 6 лет назад

    The composite collider is really a great technique that I didn't know - could save a lot of trouble... haha very good videos!

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +1

      I've found it not long ago, such a great component. :P Solves all the previous problems.

  • @pratikdhanawate8648
    @pratikdhanawate8648 2 года назад

    Really helped in solving the problem that got me stuck on not one but two games

  • @Alex_DeltaDev
    @Alex_DeltaDev 3 года назад

    Great tutorial, cleared up a couple of nagging questions I had about composite colliders. Took the collider count in game down from 1000+ to 10, so quite the improvement as you could expect! XD

  • @iansong1676
    @iansong1676 6 лет назад +1

    Another awesome video! I love you little animations on the side. Also thank you so much for going over Time.deltaTime! It really helps me a lot.

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +2

      I'm glad you liked it. ^ - ^
      I think I'll mention Time.deltaTime and stuff like Update() FixedUpdate() more in the future. They are just such frequently used things.

    • @milanstevic8424
      @milanstevic8424 6 лет назад

      when you get the hang of it I'd also recommend writing your own wrapper for the delta time in general.
      that'll put you in much more control over the time flow in your game.
      as an example, while setting time scale to 0 is useful to pause the game, it would also freeze all of your animations in place (because they rely on this scaled delta time), and you'd probably want to keep some of them in your pause menu.
      you could also use the so called unscaled delta time, but oh boy, rolling your own is always much more handy. and can be fun as well.

  • @freemind.d2714
    @freemind.d2714 5 лет назад

    watch so many video, this one finally helped

  • @TheHobbit28
    @TheHobbit28 6 лет назад +1

    Great Vid! Like your style of presentation a lot

  • @paulalexandercruzesteves576
    @paulalexandercruzesteves576 3 года назад

    Good video is just what I was looking for , thanks :D

  • @a_soulspark
    @a_soulspark 6 лет назад +13

    The little 2D Ferret is lovely!
    Also, how hard would it be to add jumping in this game?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +14

      Hey, thanks! :) Well, it depends on what kind of jumping you are talking about. If it's a tumble like dodging arrows fast, then it's pretty easy and I'm planning to do that. However, I have a feeling you are thinking about real jumping like between platforms an such. It remains simple as long as the overall world of the game is flat. Like in this game, the map is flat and there are no hills, the "terrain" is flat. But if you want to have hills or platforms that are taller to jump in between them, then it becomes very cumbersome in this game's full 2D solution. And I would recommend a 3D isometric solution with the same sprites. You couldn't tell the difference in looks. It's a bit harder to implement the basic mechanics but handles the 3D space way better (because it's literally 3D) so any kind of jumping would be possible to implement. All in all, if your jumping remains in a flat world then it's easy, but if it requires upwards and downwards motion in a 3D space like in Monument Valley, then this 2D solution makes it hard and not feasible.

  • @redhawkrobin
    @redhawkrobin 2 года назад

    This was a pretty awesome tutorial!

  • @nasym909
    @nasym909 5 лет назад +2

    Thanks for everything you helped me a lot can you do more tutorials top down about jumping thanks again

  • @tiskolin
    @tiskolin 6 лет назад +18

    Why add a rb? Isn't just a collider enough...?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +9

      Yep, it should be enough to just put an rb on the player and do the walls without one. I think I'll dedicate a whole episode to the collision matrix in Unity and I'll fix this then. Thanks for pointing it out though! :)

  • @krisitak
    @krisitak 4 года назад

    Thank you, high quality stuff.

  • @narrenschlag
    @narrenschlag 5 лет назад +1

    That is so great. Why haven't I found you earlier :D

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад +2

      Thanks! I’ve been playing hide and seek on RUclips, that’s why. :D

  • @LordnachCTM
    @LordnachCTM 5 лет назад +1

    Why is this channel so hidden from the world, damn you YT for not showing me this before

  • @SixGunsTV
    @SixGunsTV 5 лет назад +1

    thanks for ur amazing help!

  • @sgt2615
    @sgt2615 6 лет назад +1

    This helped me so much, Thanks

  • @mayankkela8485
    @mayankkela8485 5 лет назад +1

    Thanks you solved it my typical problem

  • @kamilniezorawski7244
    @kamilniezorawski7244 6 лет назад +1

    Great tutorial, thank you

  • @betrayedpickle291
    @betrayedpickle291 2 года назад

    thanks, this was SUPER useful

  • @anselmadsen3348
    @anselmadsen3348 6 лет назад +4

    you are the new brackeys my friend

  • @kamilstudios
    @kamilstudios 3 года назад

    Awesome tutorial!

  • @kjp312
    @kjp312 5 лет назад +1

    Helped me a lot

  • @faithmorante
    @faithmorante 2 года назад

    This helped me alot thanks!!

  • @Eragarev
    @Eragarev 2 года назад

    I never knew about the composite collider thing.

  • @vsr3276
    @vsr3276 6 лет назад +1

    Great tutorial series! I have a question tho, will you make this online multiplayer or local? I subbed to you btw

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад

      I only have plans for local multiplayer. It would be fun to have online multiplayer, but it would take a lot of time to get it right, and with that time I could develop the next game instead. :) Thanks for the sub, and welcome to my channel! ^ - ^

  • @javiaguilar1156
    @javiaguilar1156 5 лет назад

    Very well explained tutorial. Could you make a follow-up tutorial on how to restrict the player movement to the grid? Like in old games like Pokemon Gold and Silver, where each time you press a direction the player moves exactly 1 cell in that direction.
    Thank you

  • @RELOADEDhub
    @RELOADEDhub 5 лет назад

    thanks its really helpful for me in my project ..

  • @clapper2564
    @clapper2564 3 года назад +1

    You're the best!!!!!

  • @toaster-chan7386
    @toaster-chan7386 3 года назад

    Hey so like, I might need some help. So with my top-down game, I can't seem to get the walls working right, how do I get it to look like my character is going behind the wall? When the player walks in front of it, the layers work fine, but I can't get him to walk behind it without still appearing on top.

  • @LarS22730
    @LarS22730 5 лет назад +1

    fantastic tutorial man! great improvisation when explaining.
    maybe next time you need to make more lil bit entertainment in the tutorials like a joke or something to make it not too boring 👌

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад +2

      Thanks! Yeah, I'm thinking about the entertainment part of the video a lot. I don't want to have you guys to fall asleep. :D But because I write the scripts for the voiceover beforehand, and I'm not an actor :D the little jokes doesn't really end up being good in the end. I plan to go off script soon, let's see how it will go. :)

    • @LarS22730
      @LarS22730 5 лет назад

      @@CouchFerretmakesGames heck yea, gdluck with that ' w')b

  • @WoThFal
    @WoThFal 6 лет назад +2

    Hey! Thanks for the tutorials! i really enjoyed watching them and learning something :0 i have a question and that is how do you make a character jump in a top down game? I've been looking for it in a lot of places but haven't founded the answer. I dont know if you could make a video or guide me to the materials i need do it.! Thanks!!

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +2

      Hey! :) Well, it depends on what kind of jumping you are talking about. If it's just a simple jump like jumping over a fence, then it isn't that difficult, just a few tweaks with the colliders for a short amount of time to let the character go through the fence. However, I have a feeling that you are thinking about jumps between platforms and such. The thing is that it remains simple as long as the overall world of the game remains flat game mechanics wise. For example in this game the map itself is flat, there are no hills. But if you want to make the character jump between platforms with various heights and fall if he fails to jump long or high enough then a 2D solution like this game have will be tough. I would recommend making your game in 3D isometric perspective but using 2D sprites to still keep the 2D feeling. In 3D you can simulate the correctly the positions and not just fake the third dimension like I did in this game. However, if your platforms and the ground remains flat in your game, and you only have a flat surface with holes in it, then that could be managed in this 2D solution. Hope I make sense! :D Let me know your plans in detail so I can suggest a solution for it. Like reference existing games, or describe the limits of the system, so we can decide that a 2D solution works for you or it would be wiser to switch to a 3D but 2D looking game. :) Cheers!

    • @WoThFal
      @WoThFal 6 лет назад +2

      @@CouchFerretmakesGames Thanks for your response! Looks like im going to make it flat then! haha, You caught me, i was thinking in simulating that kind of 3D. Mostly for pits or cliffs so the player can jump them down, (just like in Hyper light drifter or in CrossCode) However i dont think im going to add it, but the curiosity got me to ask you. Thanks again for your time to answer me. it really helped me a lot!

  • @ethanbeers7497
    @ethanbeers7497 2 года назад

    how do i get my character to be behind the object when he moves behind it instead of just walking thru it. im talking about outside of the box collider but supposed to be behind the object

  • @The5thAstronaut
    @The5thAstronaut 5 лет назад +1

    my player has a rigidbody2d and box collider while my 'buildings' tilemap has the tilemap collider 2d, but my player still walks over the building tiles. Is there anything else I should watch out for? Or something I'm missing? They're both on the same sorting later, and the same blocking layer and my players body type is kinematic.

  • @xxashleythefoxx6765
    @xxashleythefoxx6765 5 лет назад

    Thank you your a Lifesaver

  • @WolfieMoonDev
    @WolfieMoonDev 4 года назад

    Would you be able to do vs code tutorials to?

  • @wowvain2989
    @wowvain2989 4 года назад +1

    Hey man! I have a question that apperantly no one else answered on forums and such. When I collide with a wall from the front, everything works fine and my characters shows above the wall, like it should, but when i collide with a wall from behind, my character still shows over the wall because its sorting layer is above the wall. How do I fix this? Is there a script or a setting i've overseen?

    • @samu3lp88
      @samu3lp88 4 года назад

      make player and walls layer = position.y

  • @clementiine4422
    @clementiine4422 6 лет назад +2

    is there anything i can use other than unity?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +1

      Godot is a good and free alternative, but you could use most of the game engines out there probably.

    • @clementiine4422
      @clementiine4422 6 лет назад

      ok thanks!

  • @Andrew90046zero
    @Andrew90046zero 5 лет назад +1

    Why do the walls need a kinematic rigid body? If they are static, wouldn't they not need to move? Or does giving them kinematic bodies help with something?
    EDIT: I noticed you eventually removed them, but you then had to put a rigidbody in the grid object, which is still a bit odd.

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад

      You are right! The individual walls didn't need to be kinematic they could have remained as static objects. I messed it up, I'll make sure to have a dedicated episode on the collision matrix to sort this out once and for all. :) Thanks for pointing it out!
      Odd, I know, but the CompositeCollider requires a RigidBody2D component. It was strange for me as well and I tried to remove it, but no luck.

  • @Moon-to9se
    @Moon-to9se 2 года назад

    Thank you so much!

  • @heytheremogwai
    @heytheremogwai 4 года назад

    I have a sprite with a box collider, and I have a tree with a poly collider. Collision is detected, but my character sprite also pushes the tree around. How do I make it so that the tree doesn't get pushed around?

  • @myuradha
    @myuradha 4 года назад

    At 5:53 how to implement that in game side-scrolling

  • @DebugFrog
    @DebugFrog 5 лет назад +1

    Hello, your tutorials are fantastic!! I've been working on a top down 2D game and I was wondering if you'd be able to answer a question? :) I've followed yours and many other's tutorials for getting solid collisions with walls working, but no matter what I do, my character slides right through the colliders. I have rigidbody and colliders set up with is trigger unchecked, my character has a rigidbody and a collider, i've even checked that the player isn't moving too fast for the collider to detect - everything seems like it should be working, but it just isn't. Thanks so much for your videos!!

  • @MycoalD
    @MycoalD 4 года назад

    thanks, this helped!

  • @henrymontalvo384
    @henrymontalvo384 2 года назад

    How do you make it so the player can appear above the wall when below it and behind it when above in 2D?

  • @mayankkela8485
    @mayankkela8485 5 лет назад

    Thanks you couchFerred

  • @Exorion1er
    @Exorion1er Год назад

    Why does your Grid object need a Rigidbody2D ? Colliders can be standalone

  • @ramicky16
    @ramicky16 5 лет назад +1

    Hello! Thank you for your work! I have a question though :o What about a body of water.. I don't want it to kill the player I wanted it to block the player just like a wall.. but The player is supposed to open a bridge that goes through the water.. do i make 2 separate game objects for the water with different colliders or is there a smarter way?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад

      I think I would go for the 2 separate game objects, or even 3. The third one begin the bridge which will be turned of if the player has opened the bridge.

  • @게임개발흥미
    @게임개발흥미 5 лет назад +1

    amazing!!

  • @Ziplock9000
    @Ziplock9000 Год назад

    You know you can click the 'Edit Collider' and visually change the position and size rather than guessing and putting values in Offset and Size

  • @Mythorian
    @Mythorian 6 лет назад +1

    How to make it so the animation stops when walking into a collision?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад

      That's a tough one, but pretty cool idea. I'll think about it to have it in the game. Thanks! We could achieve that with collision detection functions like OnCollisionEnter2D, and with a new animation parameter. However, I think the main struggles with this would be to find out that the character actually running into the walls or just running near the walls.

    • @milanstevic8424
      @milanstevic8424 6 лет назад

      @@CouchFerretmakesGames (didn't watch the video yet but) the animation should stop only when the character velocity stops. if the character sprite stops due to hitting a collider (velocity = 0), its animation should also stop (animation = 0). if it doesn't stop (velocity > 0), the character is either sliding along the edge of the collider or not hitting the collider at all, so the animation shouldn't stop as well (animation > 0). the result will look natural, and the game will play as expected, with no major changes (not even OnCollision events are needed).
      you already have the case where velocity = 0 and animation > 0, which is basically the idle animation. (if you don't have it already, it's well supported anyway), and the only case where you want the case of velocity > 0 and animation = 0 is if you want to have a character fly off due to damage (maybe bounce in the air slightly like a ragdoll) or some other physical force that might act on him (you know, like spring traps etc). in that case the walking animation might appear uncanny, simply because his legs are detached from the ground, and in general, this is how you convey the notion of an involuntary movement in such games (if no other animation is dedicated to this context).

  • @LaCreArthur
    @LaCreArthur 4 года назад

    Really nice explanations with your illustrations. A bit slow paced for me but with 1.5x speed it's perfect :)

  • @shockingshinx12
    @shockingshinx12 5 лет назад +1

    I'm still having the issue where the character bounces back from the walls even after adding that line of code in the script?

    • @goingsillymode
      @goingsillymode 3 года назад

      i'm having the same problem, did you ever figure out how to fix it?

    • @shockingshinx12
      @shockingshinx12 3 года назад

      @@goingsillymode No I did not, sorry

    • @goingsillymode
      @goingsillymode 3 года назад

      @@shockingshinx12 alright, thanks anyways!

  • @kiwioverlord9519
    @kiwioverlord9519 5 лет назад +1

    Hi CouchFerret, it's been forever since I asked you for help not because I've stopped programming, but because you answered all my old questions so well that I've been doing just fine! :D Anyway, lately I've had a more technical problem: you know how if you make a gameobject, object A, the child of another gameobject, object B, then object A's collider also registers as object B's collider right? Well the issue is that I have a weapon that is a child object of the player. The issue is that when an enemy's weapon and the player's weapon collide, the player takes damage because their weapon is part of their hitbox. Can I make a parent object not register the collider of its child object, or is there any other solution to this issue? Some workarounds I've tried were to make a separate game object the hitbox of the player and do transform.position=player.position instead if making it a child object, but this has it's own drawbacks.

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад +1

      Hey Kiwi!
      I missed you! :D I hoped that you haven't stopped working on your games, I'm glad you didn't. :)
      In a collision, you can access the exact colliders that were participating in it, and based on that you can handle the different scenarios.
      So for example:
      void OnCollisionEnter(Collision collision) {
      // This will be the sword's collider for example when the enemy hits your sword
      // But it will be your body's collider when the enemy hits you
      Collider myCollider = collision.contacts[0].thisCollider;
      // And this one is the enemy's sword's collider, this could come in handy
      Collider myCollider = collision.contacts[0].otherCollider;
      }
      But instead of checking the exact participating gameobjects, I would go with checking their tags and decide the damage taking based on that. Like for example, there would be "weapon" and "player" tagged objects with collider on them.
      Hope this helps! Let me know if not. :D Cheers!

    • @kiwioverlord9519
      @kiwioverlord9519 5 лет назад +1

      @@CouchFerretmakesGames Hey, I've missed you too! It's been awhile since me met, but it feels like just yesterday you had only 400 subs! Now you have 4,000?! Well done and well deserved! And I don't imagine I'll stop programming anytime soon, I've had some success with my game on Itch.io: I reached 250 views :D , and there's no way I could've done it without you. 250 thanks you's!
      I'm a bit confused about the Collider myCollider = other/this Collider
      How does the other/this argument work?
      And I do use the tags "weapon" and "player" to deal damage; the enemy's weapon has a script "Weapon", which runs like this:
      if col.gameobject.tag = player, col.getcomponent player.HP-=10
      but its still an issue because when the enemy weapon collides with the player's weapon, the weapon counts as tag = player since its a child object of the player, and the player takes damage.

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад +1

      @@kiwioverlord9519 Hey Kiwi! I've put together an example for you and sent it in an email. However, the code looks like this and is attached to the Player gameobject (the parent):
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class MyScript : MonoBehaviour
      {
      public Collider2D playerCollider;
      public Collider2D swordCollider;
      void OnCollisionEnter2D(Collision2D collision)
      {
      ContactPoint2D contact = collision.contacts[0];
      if (contact.otherCollider == playerCollider && contact.collider.tag == "Weapon")
      {
      Debug.Log(gameObject.name + " get hit");
      }
      if (contact.otherCollider == swordCollider && contact.collider.tag == "Weapon")
      {
      Debug.Log(gameObject.name + " parried");
      }
      }
      }
      And the swords are a simple child object with a collider. Oh and yeah the Players have rigidbody2d components because they are necessary for collisions. :)

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  5 лет назад +1

      @@kiwioverlord9519 And thank you for the support :). I really appreciate it, and I'm glad that my work helped you. I'm happy to hear that. :) Don't forget to link your game so I can check it out.

    • @kiwioverlord9519
      @kiwioverlord9519 5 лет назад

      @@CouchFerretmakesGames Hi, oh yeah here's the link: kaiway.itch.io/spintowin
      It's pretty sophisticated if I do say so myself, so take a look at the Controls page. Also, I've got to add you to the Credits section! Is there a way to make Unity redirect to a link, like your RUclips page? And how do you want to be addressed in Credits? Just "CouchFerret"? And my support is the very, very least I could offer for the absolutely priceless help I've received from you! :)

  • @letsplaynay9936
    @letsplaynay9936 4 года назад

    When my character touches the colliders, my background rotates? why is this?

  • @siddharthsen4475
    @siddharthsen4475 6 лет назад +1

    Thanks

  • @JulioCsw
    @JulioCsw 6 лет назад

    Just epic =D

  • @iam0ri
    @iam0ri 3 года назад

    A very helpful tutorial as I was having issues with my top down colliders working. However, I was using transform for my player movement as this allowed me to snap to grid on movement. Turning this into a velocity causes movement to... drop down (as in a platformer) and snap back to what it's location should actually be. Played around with gravity in the project settings and on my rigid bodies to no success. Anyone have thoughts?

    • @zeea6561
      @zeea6561 Год назад

      If I'm understanding correctly, Rigid body 2d needs to be set to kinematic

  • @tuke4202
    @tuke4202 5 лет назад

    The collision doesnt work for me if i have kinematic

  • @jackripper7578
    @jackripper7578 3 года назад

    My respect

  • @kureshimiru
    @kureshimiru 5 лет назад

    Hi, I'm trying a movement solution almost exactly like yours, using Rigidbody2D's velocity property, but my character's movement is extremely jerky this way.
    My mini-script contains a playerRb (Rigidbody 2D) parameter, a Vector3 movement vector, a function called ProcessInput() that consists of only a single line (movement = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0.0f)), a Move() function also with a single line (playerRb.velocity = new Vector2(movement.x, movement.y) and an Update() function that calls ProcessInput() and then Move().
    Has anyone solved this problem? It can't be only me...

  • @arandomhashbrown3756
    @arandomhashbrown3756 6 лет назад

    New subscriber

  • @Moreno6000
    @Moreno6000 4 года назад

    So why does my oncollision event not work it's driving me crazy

    • @gamerheroine
      @gamerheroine 4 года назад

      might need to click the 'is trigger' for oncollisionenter function? Or make sure the 2d vs not 3d's match for collision types. Those are my usually things that cause me problems but I'm not expert

  • @jeremiemorinderuyter9817
    @jeremiemorinderuyter9817 6 лет назад +2

    Lovely character, by the way too avoid making all your variable "public" when want too see them in the inspector you can use the decorator "serializefield" , here the link to the documentation : docs.unity3d.com/ScriptReference/SerializeField.html .

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад

      Thanks for the suggestion. I should have mentioned it in the video. I'm aware of the SerializeField decorator, but I'm coming from a Python background where there are no access modifiers and you are also allowed to do almost anything. I like this kind of freedom, and I think it's a bit clearer too (but more error-prone too). However, both the SerializeField and public are accepted and commonly used practices. I think I'll mention it in the next programming episode. :) Thanks!

  • @Caslte371
    @Caslte371 6 лет назад +1

    Can I see scripts code?

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад

      I'm working on it to have the scripts available online. Unfortunately, until then they are only visible in my videos. :/ I'm sorry!

    • @Caslte371
      @Caslte371 6 лет назад

      @@CouchFerretmakesGames can u load them on cloud or github for now? Ты случайно русский?

  • @sparklestorm1236
    @sparklestorm1236 Год назад

    thank you for calling me a game dev. I don't know if I would go as far as to say that, but thanks anyway

  • @Bignose_Dev
    @Bignose_Dev 3 года назад

    my damt player didint making collide i no idea i have all compoments !

  • @RedstoneHair
    @RedstoneHair 4 года назад

    Why does my character slide????!!!!!!

  • @glassystudio
    @glassystudio 4 года назад

    Arnold Schwarzenegger teaching game development

  • @fisash9737
    @fisash9737 4 года назад

    а со слоями у тебя всё в порядке а? м?

  • @Aaaalfaroeo
    @Aaaalfaroeo 4 года назад

    Great, but now player's hitboxes are in it's feet.

  • @keithzhengzhaokhong2782
    @keithzhengzhaokhong2782 4 года назад

    nvm its a 2d game. Nice

  • @irishbruse
    @irishbruse 6 лет назад +1

    you shouldnt be putting a rigidbody on the wall its bad for performance only one rb is required for a collision.

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад +1

      That's true, thanks for pointing it out! I should have covered static colliders (without rigidbodies) in this episode. I'll try to talk about it in the future. Although at the end of the video I have only 2 rigidbodies, 1 for the player, and 1 for all of the walls (on the Grid). Sadly, CompositeCollider2D requires a RigidBody2d. :/ But, and extra rigidbody or even a couple of extra rigidbodies won't have a huge difference in performance. Usually I try to keep things simple, but want to cover more advanced stuff in the future too. The Collision action matrix would be awesome to cover with all of its 6 different kinds of gameobject setups. Thanks again for the critic! :)

    • @irishbruse
      @irishbruse 6 лет назад +1

      @@CouchFerretmakesGames no prob im enjoying your vids tho they are really well put together. :)

    • @CouchFerretmakesGames
      @CouchFerretmakesGames  6 лет назад

      @@irishbruse Thanks! I'm still seeking ways to improve it.