Ways to have only some collisions get resolved handled by Unity Physics, while letting all collisions be detected by code
Often, I want certain GameObject
s, which I’ll hereafter refer to as “entities”, to exhibit the following properties: I want entities to use Unity’s physics system for collision with terrain, but to pass through fellow entities (So enemies and the player, which would be entities, can stand on the ground but not on each other, etc.) However, I still want scripts I write to be able to detect when entities overlap (So enemies can turn around when they walk into each other, etc.).
Unity Collision between Box Collider 2D and Tilemap Collider 2D not working
I started developing with unity a few days ago.