The following diagram shows how the smell system works:
Just like the hearing recipe based on colliders, we use the trigger colliders in order to register odor particles in an agent's perception (implemented using a dictionary). When a particle is included or removed, the odor centroid is computed. However, we implement a function for retrieving that centroid because, when no odor particle is registered, the internal centroid position is not updated.