How to create a touch zoom/pan camera that works inside a small viewport to interact with a large image

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By redwave1992

Hi fellow developers

As the question above how to create a small viewport that can interact with its camera to pan and/or zoom using touch on a large image?

I tried using the touchcamera code found in kidscancode website but it does not work with my node setup. I even passed the inputs from parent node to the viewport but still does not allow me to pan/zoom the large image.

I also tried adding world to viewport and setting it to 2d and handling input local to either checked or not checked but it does not work.

Below is my node setup:
Main node: sized 720widthx1090height portrait on mobile
– other node control
– subscene (viewport node)

Viewport container:(subscene) sized 500x500
– viewport
----camera (current option is checked)
----large image 2000x2000

Is there any setup i need to do?