Vision Sensor Hight Command

I am learning how to use the vision sensor and I typed in this line of code

int size = VisionSensor.objects.height;
but I highlights the word Height in red and says
[clang] No member named 'height' in 'vex::safearray<vex::vision::object, 16>'
Please help

You want the size of one specific object, not just “objects” in general. Usually you’re looking at the largest object, in which case you would say VisionSensor.largestObject.height

Here’s the vexcode vision sensor api: https://api.vexcode.cloud/v5/html/classvex_1_1vision.html#a179bd267546e0f633a133bfaad961a8b

5 Likes