Distance.Found_Object not working?!?

I’ve tried to make a simple object sensor script but the code doesn’t work? I’ve read up about it and I’ve seen the examples besides the coding but it doesn’t help.

Library imports

from vexcode import *

Add project code in “main”

def main():

    if distance.found_object():
        drivetrain.stop()
        drivetrain.turn_for(RIGHT,90,DEGREES)
    else:
        drivetrain.drive(FORWARD)

VR threads — Do not delete

vr_thread(main())

I’ve left the original stuff on. This middle code doesn’t work? It’s a simple if-else statement.