Hi,
I need to limit max and Min scale when object has transformGesture with Scale,Rotate translate
Thansk you
The place to discuss touch and gestures related stuff in Unity
public void ApplyTransform(Transform target)
{
// solo escalamos si estamos dentro del rango max y min.
if (!Mathf.Approximately (DeltaScale, 1f)) {
Vector3 aux = target.localScale * DeltaScale;
//debug.text = (aux.x).ToString();
if ((aux.x > 0.4f) && (aux.x < 3.91f)) target.localScale *= DeltaScale;
}
if (!Mathf.Approximately(DeltaRotation, 0f)) target.rotation = Quaternion.AngleAxis(DeltaRotation, RotationAxis) * target.rotation;
if (DeltaPosition != Vector3.zero) target.position += DeltaPosition;
}
Users browsing this forum: No registered users and 4 guests