Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Possible to Make Point Effector 2D / Area Effector 2D to Ignore based on Condition

Discussion in 'Physics' started by Reimirno7, Jun 8, 2023.

  1. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    I know you would use collider mask but in my current setup there are stuff that are on the same collision layer but I only want to make point effector affect some of them (determined at runtime).

    For example enemy's point effectors should not affect itself but should affect other enemies. All of them are from the same prefab and thus in the same layer. There are many of them you can't give every single one a uniuqe collision layer either.

    If this is not possible, any pointers as to how to achieve a point effector 2d with this runtime custom ignore?