Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Multiple Colliders interacting with Tilemap Collision

Discussion in 'Getting Started' started by Pureandy, Oct 28, 2022.

  1. Pureandy

    Pureandy

    Joined:
    Feb 3, 2019
    Posts:
    2
    Hello,

    I have multiple Objects attached to my Player. PlayerHitBox, PlayerRange etc.
    upload_2022-10-28_20-51-57.png

    My Player has 1 BoxCollider2D that i want to use for Collision.
    The Other Objects for example PlayerHitBox has also a CircleCollider2D, but I dont want that Collider to have anyform of Collision with my Tilemap its just for TriggerEvents with other Colliders.

    The problem is that even the CircleCollider2D is used for Collision and is affecting my Movement of the Player.

    My Player:
    upload_2022-10-28_20-49-39.png

    The PlayerHitBox subObject:
    upload_2022-10-28_20-50-16.png

    I am using a TileMap and with that a TileMapCollider2D, dont know if that is part of the Problem.
    Thanks in advance for any Tips regarding this.
     
  2. Pureandy

    Pureandy

    Joined:
    Feb 3, 2019
    Posts:
    2
    I fixed the Problem!
    Instead of using the rb.Cast. I use the Cast Methode on the singular Collider that i want my Collision with.
    Collider.Cast(...)
     
  3. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    Aw, aren't you a clever lad? :D