Search Unity

Detect if a non-trigger collider is inside another collider

Discussion in 'Physics' started by CaptainOtter, Jun 25, 2018.

  1. CaptainOtter

    CaptainOtter

    Joined:
    Aug 27, 2016
    Posts:
    11
    In a game I'm working on, the player can teleport into any point of the map. This results in a case where player can be teleported for example inside a rock (or any other solid object). When that happens, I want to disable all colliders of that rock object and enable them once player exits the object. I want all solid objects to have this functionality and for them to detect the player and not other way around.

    Problem I am having is detecting when player is suddenly teleported inside another solid object, since they both have a solid colliders and not triggers. I'm just trying to figure out possible ways to achieve this and would appreciate some pointers in right direction.