I’ve tried to implement the pinch gesture for my game but I am running into issues. (I’m only using it for zooming - not rotation)
Firstly i’m using the PinchGesture::Scaling(), but this resets between each pinch gesture which makes the zoom jump back and forth - is there a better way?
Also I’m experiencing that the zooming stops working sometimes.
I should mention that I am also using DragCameraWithPointer extension for moving the screen - could these two extensions be interfering?
I should mention that I am also using DragCameraWithPointer extension for moving the screen - could these two extensions be interfering?
Of course
You should disable drag camera when you use pinch
IDk how pinch extension works
But i guess there is condition to check if there is a pinch
If so you simply run drag camera only where there is no pinch
I use both the pinch and the drag camera extensions in the same project. I don’t use any of that expression stuff with scaling. In my drag camera events I have an inverted touch is pinching condition and then the drag camera action. I can’t remember if it was necessary or I did it for some other unrelated reason. A quick test now, there is some jumpiness if I don’t have the condition.
But there is an alternative. You don’t actually need the drag camera extension if you are happy to have both zooming and panning done with two fingers.
Then move the two actions related to camera position from the first event into the zoom sub event action. Now you can pan the camera while zooming. You can still use the drag with camera extension if you want, I do. It means panning can be done with one or two fingers. In the constraints action, you choose zoom only.
Maybe my way of changing the events is not optimal, that’s why I submitted a request for the extension to be changed.
I currently use a simple:
CameraZoom = CameraZoom*PinchGesture::Scaling()
and then clamp it.
But I feel that it is very hard to control the zooming effect in the game, you always end at the extremes?
If it’s causing a problem then try not doing it. Why are you using pinch expressions? The extension works perfectly without them. I do this 1. enable pinch, 2. change its constraints 3. change zoom with limits. I’ve used it a lot and it works perfectly.
Thnx @Bubble I never realised that the zoom worked without using the pinch expressions
And the jumpyness in zooming is gone without it. You are right it works perfectly.