Hi,
Here i found some easy and really good script to make image zoomable movable in scene canvas.
It works great on PC but on mobile i cant zoom in and out with fingers, only drag the picture.
Could anyone tell me how to fix it?
Thank all.
In mobile, you need to make sure multitouch is enabled in the input settings and use Input.touches for this. Check threre are more, than one touch, take first two, calculate distance, remember it, and in the next frame do the same again. Compare new value with one you saved initially and use it in place of eventData.scrollDelta.y
First, you need to move the content of OnScroll method to separate method what accepts float delta parameter and call it from OnScroll using eventData.scrollDelta.y
Second, you need to read touches in the Update method, calculate delta as I said, and then call that new method using calculated delta as it’s argument.
Your question is really simple, probably this will help https://unity3d.com/learning-c-sharp-in-unity-for-beginners