Hello,
Scenario
I have a 3D object when I would like to scale along x & y (local) when user pinches. Now this 3D object might be in 1:1 ratio or 16:9 ratio. I have no control over it. When user pinches, I want to scale appropriately.
Pinch delta values are very small. Somewhere between 0.1 to -0.1. Hence it is not about the magnitude.
Existing Code
scaleMagnitude = new Vector2
(
scaleMagnitude.x + _value,
scaleMagnitude.y + _value
);
this.transform.localScale = new Vector3(scaleMagnitude.x, scaleMagnitude.y, 1);
Expectation
I add the same values over x & y which make me believe - it is not being scaled by maintaining it’s aspect ratio.
Request
- How do I do it?
- How do I cap a min & max to clamp the scaling?
Thank you,
Karsnen