I have a fake N64 joystick (yes! just the joystick) from a faux N64 controller. This joystick only outputs analog values in one direction, that is when the joystick is in the middle, analog read outputs 0. Moving the joystick to the left shows 0. Moving the joystick to the right shows an increasing value from 0 to nearly 4000.
Thank you very much for your suggestion. The pot works albeit its not very accurate. Joystick movements are not linear.
Taking the above picture, for my usage, the left pin goes to ESP32's 3.3v, the middle pin goes to an ADC pin on the ESP32 and the right pin goes to ESP32's GND. Now i get values using a sample ADC sketch.