Search Unity

No collisions between my sprite and my tiles

Discussion in '2D' started by emiliancarnu2008, May 8, 2021.

  1. emiliancarnu2008

    emiliancarnu2008

    Joined:
    Dec 27, 2020
    Posts:
    1
    So i made a 3D project, but i am making a 2D game, so i have a car sprite (with the Rigidbody2D and PolygonCollider2D components) and some tiles that have the type set to sprite, but no collisions, is there a fix?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Ignore talking about visuals like sprites as they have no impact on physics. It takes two colliders to come into contact for a collision to happen and you've only described one side of this with your "car". The other side is vague as you only say "some tiles that have the type set to sprite". So have you set-up collision shapes on those tiles and added a TilemapCollider2D?

    If not, then I would suggest going to Google and searching for one of the many tutorials on Tilemap collisions. Much easier than going over it all here.