Vision Sensor not detecting color

I am having trouble with my vision sensor code. It is meant to find the red color of the goal, and orient it to face to the goal:

void Aim(){
  if(Vision.objectCount > 0){
    //Implementation not shown
  } else {
    Controller1.Screen.print("Unable to detect object");

The specific problem is that it keeps going into the else part of the code, not detecting any objects. It just keeps going printing to the screen “Unable to detect object”. I have set up VEXRED in the vision sensor, so I’m not sure what’s causing this.

What does the vision dashboard show when your code is running ? It should see something like this (signature 1 is selected here)


If the dashboard does not show the object you are trying to detect, then tune the signature some more using the vision utility.