How do I give a creature sight/smell?

How do I give a creature sight/smell?
In my simulation, there are spherical creatures, food, and viruses (which aren’t actual game objects, just a separate part of the same code). The creatures change color if they are infected, and I want them to be able to see and smell food and other creatures. Creatures have a diameter of one, and food has a diameter of 0.5. Creatures are shown in colors between red and green, and if they are infected, then their color gets a certain level of blue added, depending on a specific virus trait. These are the traits:

bool infected = false;
float moveSpeed = 1f;
float turnSpeed = 0.5;
float sightRange = 2f;
float scentRange = 2f;
int otherInfected = 256; //range is 1 - 256. 1 means that the creature can tell if a creature is infected if it has 1 or more blue added to the rgb scale, and 256 means it can't detect it at all, as the rgb scale is 0 - 255.

I won’t include any other code because it is irrelevant to my current question.

For many kinds of proximity detection, you can use OverlapCircle or OverlapSphere.

This will give a list of colliders that it hit. Of course, you will need to add colliders to all your detectable objects. After you get the list, for each item, do a GetComponent() to check their status or other data.

  1. List item

you can make an invisible box/sphere around the player and when another object collides with it then it can detect that object but for sight it better to use raycasts

They still sound like game objects if they move around and such.

Use a collider as a trigger. Say we add a sphere collider to each object that is larger than them, and set it to trigger. Also, I recommend using tags to mark the viruses and food. This is more efficient than using names. Then, in the code for the viruses and bacteria, add:

    OnTriggerEnter(Collider other){

    if (other.CompareTag("Food")) {Do this} //Collision with food trigger
   if (other.CompareTag("Virus")) {Do that} //Collision with virus trigger
    }

Hope this helps.