Removing circular chunks of objects in 2D game

Summary of problem:

  • I have an object with a circular radius of effect
  • As it gets close to objects, I want them to disappear, but only the overlap between the circular area of effect and the object.
  • I also want to disable the colliders for the vanished bits.

Any thoughts on how to do this? My preliminary ideas are:

  1. Since this is a 2D game, I can do depth tricks. For example, I can move the objects a few meters backwards and overlay a circularish chunk in front of them. I could make this chunk a trigger with scripting that disables colliders while things are inside it, so objects can move through.

  2. I can hide the object completely and replace it with very small tiles that vanish when they’re in the area, temporarily.

Ideally, though, I’d just like to specify the areas to wipe away, and have the collider mesh and the rendering area disabled for that part (and come back when the area of effect object leaves).

Any insights would be greatly appreciated :slight_smile:

Disabling rendering and collision of entire objects within a given area of influence should be relatively easy, but it sounds like you’re asking about disabling parts of an object where it overlaps with something else? That should be possible in theory, but sounds extremely difficult, especially if you’re editing collision on the fly.