Distance sensor callback help

I am using the v5 distance sensor and using the changed method. The function I pass is supposed to see if an object is detected 5 inches away and then spin a motor. However, when I test it, it does not spin the motor but it does call the function. I have the controller rumble when it’s called to see if it all works and it does rumble it but the motor does not spin. How do I get the motor to spin?

Code

I had to rewrite this from memory because I currently don’t have my laptop, however, this is the general premise.

void checkLaunch(void){
     if (distCata.objectDistance(inches) <= 5.0){
           Controller1.rumble("....");
           Cata.spin(fwd, 100, pct);
}

int main(){

     distCata.changed(checkLaunch);
}