Search Unity

Question Collisions between objects from different layers with uncgecked collisions in matrix?

Discussion in 'Physics' started by AndreySolo, Feb 3, 2024.

  1. AndreySolo

    AndreySolo

    Joined:
    Aug 22, 2023
    Posts:
    2
    Hello. As a training I try to repeat some lessons from Unity Learn in my 2D Clone of Space Invaders. So I tried to restrain player's movement by adding to the background's object collider and getting coordinates of it's boundaries, but meet the problem, that collider of background pushes the player out of boundaries at the start of game. Well, I learn a bit of material about layers, so I made a specific layer "background", in which put the background object, while other object, taking part in the game leave at the layer "default". Also in collision matrix I uncheck collisions between background and default layers, but the problem with pushing player out of background continues
    So, what is wrong, can anyone told, please?

    Collision matrix:
    upload_2024-2-3_10-22-37.png
    Background layer
    upload_2024-2-3_10-23-4.png
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,463
    Look at your first image. Can you see the specific Physic2D section there? You're not using that, you're using 3D physics.
     
    arkano22 and spiney199 like this.