How to use and adjust 2D collider in Unity

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

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

  • @OssyAndarii
    @OssyAndarii 3 года назад +9

    Man, I am so glad you made this tutorial, I was trying to find a way to adjust the spikes colliders in my game but I couldn't find any helpful videos. Thanks a lot and keep the good work!

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

      I'm glad that my video has helped you :) Thanks for watching!

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

    Wish I knew about custom physic sizes when started last project 🤦🏻‍♂️. Amazing video as always!

  • @0truer
    @0truer 2 года назад +3

    Thanks! When the boxes were seperate the player kept getting stuck behind really thin invisible walls, but they dssapeared after adding a compsite collider.

  • @dreaman7325
    @dreaman7325 2 года назад +4

    now this is really an amzaing tutorial! i learned so much, thanks a lot! i would love to see the next video about the layer problem you showed at the end 🙏

    • @SunnyValleyStudio
      @SunnyValleyStudio  2 года назад +2

      Thanks. The next video was meant to be a video version of my older blog post (some people preferer watching to reading). Here it is: www.sunnyvalleystudio.com/blog/how-to-sort-sprites-in-unity

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

      @@SunnyValleyStudio this is absolutely great! thank you :)

  • @alfrogiguess
    @alfrogiguess 2 года назад +1

    Thx man! Was getting caught on diagonal tiles and you rlly helped

  • @ghostev
    @ghostev 2 года назад +2

    Thanks alot, I didn't know the physics shape in the sprite editor; it's just what I needed :)

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

      كيفك يسطا

  • @Hiroki_MakeGames
    @Hiroki_MakeGames 10 месяцев назад +1

    Nice tutorial! Thanks! Now i'm trying to figure out how to make the top part of the trees and bushes with no collision .

    • @SunnyValleyStudio
      @SunnyValleyStudio  10 месяцев назад +1

      You can always create your colliders as separate Tilemap and instead of using tree tile as collision shape use something else. In general think about layering multiple tilemaps together.

  • @sten360
    @sten360 2 года назад +9

    Hey, are you still planning to release part 2? The collision and render order based on the direction the player is approaching from is what's been a pain in my side with unity tilemaps for the longest time. Really looking forward to seeing how you solved that!

    • @SunnyValleyStudio
      @SunnyValleyStudio  2 года назад +5

      Hey!
      Thanks for the feedback! I will be sure to plan this tutorial soon.
      I have a blog post about this issue based on which I will make a video so maybe it will help you:
      www.sunnyvalleystudio.com/blog/how-to-sort-sprites-in-unity

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

      @@SunnyValleyStudio Please make a video about this topic. I'm struggling to dynamically display a character on top or below a tilemap tile based on the character Y position.

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

      @@SunnyValleyStudio Yes me too please make second video if you can thanks for your help

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

      @Sunny Valley Studio The video was awesome and so the blog post, but please make a video about it, there's no sorta thing on youtube gamedev comunity and will be helpful for a lot of people

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

      @@SunnyValleyStudio for some reason the colliders aren't changing to the custom physics shape I made for some of them :/

  • @oguzhanaydn7482
    @oguzhanaydn7482 Год назад +1

    thanks for the adjust part, i couldn't find it anywhere else

  • @jonathanmaywood4568
    @jonathanmaywood4568 2 года назад +1

    Great tutorial, I didn't know about the physics shape in sprite editor.... helps a lot with one way platforms!

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

    The only tutorial that really solved my problem, im so grateful, thanks!!

  • @tPlayerioT
    @tPlayerioT Год назад +1

    thanks. This helped me, im just having a issue with the collider sometimes ignoring the player collider but eventually i will find out the issue.

  • @PvPNetwork
    @PvPNetwork Год назад +2

    Great video.
    Small thing incase anyone else have this issue.
    I had to Remove:
    Composite Collider 2D
    Rigidbody2D
    Tilemap Collider2D
    to force a regeneration of the collider after editing the sprites Physical Shape. Disabling and reenabling the component didn't work for me.

  • @KonigTheV
    @KonigTheV 2 года назад +1

    The Beginn was bad, but the it was a great Tutorial. Good Job

  • @fernzilio6087
    @fernzilio6087 Год назад +2

    Nice tutorial

  • @HenryJamesSuarez
    @HenryJamesSuarez 3 месяца назад +1

    this is what I'm looking for. thank uuuuuu

  • @denisgoodman4492
    @denisgoodman4492 Год назад +1

    Great tutorial, it's a very useful information. Thanks

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

    Very good tutorial. I didn't know such features exist.

  • @ChaosEater39
    @ChaosEater39 9 месяцев назад

    this is such a useful tutorial! it is exactly what I was looking for. thanks :)

  • @yakuperoglu5162
    @yakuperoglu5162 Год назад +1

    thanks so much bro you are a life saver thx again

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

    This video really help me, thanks!

  • @MatthewTaylor86
    @MatthewTaylor86 2 года назад +1

    An excellent video - got me subbed, thanks!

  • @triple3204
    @triple3204 Год назад +1

    When I go into wireframe mode it does not show up and then you walk through the tile map thing that I made

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

      Do you have Gizmos toggle on? It is the first icon on the top right of the scene view. Here is more info about it docs.unity3d.com/Manual/GizmosMenu.html

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

      Thank you! It works now :)

  • @Myzzz12
    @Myzzz12 2 года назад +1

    Excelent work!

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

    Very Informative Video🎉

  • @MarkWaner
    @MarkWaner Год назад +1

    But what if stairs were 3 tiles wide? Can we make it so that some sprites do not generate a collider?

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

      If you don't add a tilemap collider or make a secondary tilemap with no collider you will have stairs that don't collide with anything.

  • @idangomberg2750
    @idangomberg2750 Год назад +1

    Thank you!

  • @elmarinerito3197
    @elmarinerito3197 2 года назад +1

    teamo, eres un tipazo! muchas gracias

  • @HitsquadTTV
    @HitsquadTTV 2 года назад +1

    thx this helped me out a lot!!! :3

  • @JonelKingas
    @JonelKingas 11 месяцев назад +2

    not working idk why, wahtever i do custom physics shape not working

    • @SunnyValleyStudio
      @SunnyValleyStudio  11 месяцев назад

      Strange. Which Unity version are you using? Maybe they have changed something. Feel free to join our discord (discord.gg/RQEtYHz) and let me know since I can sometimes forget to answer comments 🙂

    • @JonelKingas
      @JonelKingas 11 месяцев назад

      @@SunnyValleyStudio It works now, i had to update aseprite importer, it worked on PNG files but not aseprite files, cause I did some research and found out only recently that there was a new version that turned on custom physics shape support on it.

  • @Gendon-
    @Gendon- 2 года назад +1

    I can't remove collider from sprite editor, how to remove it?

    • @SunnyValleyStudio
      @SunnyValleyStudio  2 года назад +1

      I am pretty sure that you can select each point and click DELETE or there might be in the top options / parameters bar to add / remove colliders.

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

    I'm noticing with rule tiles, adjusting the sprite collider does not affect the rule tile collider? Any help on a fix or work around? Thanks.

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

      Yes I think that is a limitation of those tiles. My own solution in my svstudio.itch.io/2d-procedural-island-unity-project was to manually place the appropriate tiles based on the rule tile result on a second Tilemap that was serving just as a collider (if that makes sense). Maybe you could modify / create your own RuleTile script. But that was the simplest solution that I could come up with.

  • @redspill0738
    @redspill0738 2 года назад +1

    thank you

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

    I tried to use Composite Collider and it didnt collide at all, only top and bottom was added to collision. So i stayed in Collider 2D.

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

      Hey! It is just for the purpose of optimization. Check out the documentation to learn more about it docs.unity3d.com/Manual/class-CompositeCollider2D.html

  • @32kgold37
    @32kgold37 2 года назад +1

    Thanks you!

  • @youranonymousyoutuber4051
    @youranonymousyoutuber4051 Год назад +1

    thanks a lot man

  • @travh98_
    @travh98_ 2 года назад +1

    Thank you, I love you

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

    Help me friend! I'm going crazy with the collisions in Tilemap.
    I have a cannon that shoots a bullet at the walls of a tilemap. The bullet bounces like a pool table. But the collison.transform.position and then the tilemap.WorldToCell(position) gives me the cell in the wrong grid. It doesn't return the cell where the collision occurred.
    I can even change the Vector3Int, but in collisions in the corner (diagonal) it does not return the correct tile.

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

      Maybe this can help discussions.unity.com/t/how-to-detect-on-which-exact-tile-a-collision-happened/216779

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

      It didn't. Actually the forum answer is incomplete and doesn't have any examples

  • @Clasher-1-0-1
    @Clasher-1-0-1 Год назад

    When trying to add a point in the sprite editor to make a new corner it doesn't let me and the blue square just continues to hover around

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

      Strange. I haven't encountered something like this before - well only when I was in a play mode and tried to modify something.

    • @Clasher-1-0-1
      @Clasher-1-0-1 Год назад

      @@SunnyValleyStudio I checked online and I think it may be a problem with the unity version 2022.3.4f1

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

      Getting this bug too! Super annoying!

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

      Same super frustrating

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

      @@theoingledew4031 I updated to Unity 2023.1.6f and the issue went away

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

    Hey, great video once again ! Is it possible to request a tutorial somehow ? :D

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

      Hey! Join the discord discord.gg/RQEtYHz there is a suggestion channel where you can let me know what interest you :)

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

    if player Near the wall foot , the bullet gets caught in the wall .How do you fix that

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

      Hey! I am not certain if I understand correctly but basic solution is always to tweak things until they work together.
      You bullet can have a separate smaller collider to collide with walls or I guess your wall can have a smaller collider (although its a lot of work).
      screenshots

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

    Where is the second videeeeeoooooooo

  • @PK-se2jh
    @PK-se2jh 2 года назад +1

    thankyou :)

  • @la_palma_dei_gamer4346
    @la_palma_dei_gamer4346 21 день назад

    guys someone still here? i need help why in my tilemap collider 2d do not appear "used by composite"?

    • @SunnyValleyStudio
      @SunnyValleyStudio  20 дней назад

      In Unity 6 TilemapCollider2D has "composite Operation" setting that you need to set to Merge. Beside that I think other thins says the same. If that not the case feel free to ask this on my discord and provide some screenshots and I will do my best to help! 🙂

  • @itaisinger1360
    @itaisinger1360 2 года назад +1

    nice video

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

    Second Video?

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

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

    No entiendo el ingles, pero si que entendi como resolver mi problema, Gracias Peter Griffin

  • @hungnguyentuan9590
    @hungnguyentuan9590 9 месяцев назад

    i cant creat a new blue square

    • @SunnyValleyStudio
      @SunnyValleyStudio  9 месяцев назад

      You mean in the "custom Physics Shape" menu? Maybe there is something about it in the documentation docs.unity3d.com/Manual/CustomPhysicsShape.html ?

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

    THANK YOU