On left mouse Drag i want I want to rescale the object in X and Z axis .I should able to rescale using mouse drag
Since, you didn’t give any details, it’s hard to answer you. Though, I made a script which may fit your needs :
Vector3 scale;
Vector2 downPosition ;
void Awake()
{
downPosition = new Vector2();
}
void Update ()
{
if ( Input.GetMouseButtonDown( 0 ) )
{
downPosition = Input.mousePosition;
scale = transform.localScale;
}
else if ( Input.GetMouseButton( 0 ) )
{
transform.localScale = scale + ( Vector3.right * ( Input.mousePosition.x - downPosition.x ) + Vector3.forward * ( Input.mousePosition.y - downPosition.y ) ) * 0.01f;
}
}