velocity parameter provided by UserInputService.TouchPinch event can no longer be negative, which makes implementing custom zoom logic on mobile tricky, as we now need to use scale to tell whether the player is pinching in or out. Additionally, velocity appears to be less precise than it used to be, as it sometimes is basically the same, regardless of whether I’m pinching slowly or quickly.
Velocity is always positive, else it would be a direction.
What is your use case for writing a custom zoom implementation?
We are now providing uniform gesture controls for all platforms with the same backend implementation.
I have also been having this problem in my game.
When users edit their house on mobile, they spin out of control when rotating or zooming out their camera due to the velocity values for TouchPinch and TouchRotate being different now. This issue was not happening when I released the game a few months ago (I verified this by trying out the release version of the game and this issue still persists).
It used to be negative though, I implemented my camera system like half a year ago and it worked just fine. Here is also a screenshot showing negative velocity:
I have an editor mode in my game that uses a completely custom camera system on all platforms:
@MetaVars any update on this issue?
Thanks for reporting this. You’re right, there is an issue with the velocity calculation for pinch/rotate and we’re working on a solution. I’ll report back with updates when we have them.
wondering if this is related to an issue where my code using this suddenly stopped working correctly–I had to switch it to use touchtapinworld and ViewportPointToRay instead of touchtap and screenpointtoray :
UserInputService.TouchTap:Connect(function(touchPositions, processed)
if processed then return end
local touchPos = touchPositions[1]
local ray = cam:ScreenPointToRay(touchPos.X, touchPos.Y)
We’ve rolled out a fix for this. You should be able to see appropriate velocity values for TouchPinch and TouchRotate now. Let us know if there’s anything else amiss with these.
It’s still not as smooth as it used to be and it feels a bit finicky at times but velocity can be negative again so I’m marking this issue as resolved, thanks!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.