Search Unity

not colliding with enemies outside of camera view

Discussion in '2D' started by aetztztztzzew, May 13, 2019.

  1. aetztztztzzew

    aetztztztzzew

    Joined:
    Apr 12, 2018
    Posts:
    20
    hi!
    i have 2d top down shooter with fixed camera and with enemy spawns outside of camera view.
    my player can move in all directions and when it goes outside of camera view it spawns on the other side of screen (for example player leaves screen on coordinates(-x, 0) and spawns on the other side on coordinates (x,0)).
    my question is what would be the best way to achieve player not colliding with enemies while it is out of camera view
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,383
    Turning off collision of GameObject colliders, when moving outside camera frustum.