I’m knew to unity and I don’t really understand how collisions and rigid bodies work and I don’t know what types of what to use or when to use colliders for physics. All I want to do is to have a player which I currently control with a rigidbody2d and wall which I am unsure what to do with. Everything I have tried so far results in the player phasing right through the wall. Could someone give a brief explanation of how collisions work and what bodies wont phase through each other?
By giving your player a rigidbody they will now have physics. What this means is they will have gravity (if you select that option) and have collision with objects (keep in mind you also have to give your player a collider for it to have collision). You have to make sure that the objects you want your rigidbody to collide with, have a collider component. There are many different shapes of colliders. There’s colliders in the shape of a square, circle, and many other shapes. If your wall is a rectangle or square you would give it the Box Collider 2d component . If it was a circle then you could use a Circle Collider 2d. In short, all the different colliders are there to fit different shapes and use scenarios whether that be 2d or 3d.
Hope this helped @benlyons05!