fix the error

using System;
using UnityEditor.PackageManager.UI;
using UnityEngine;
using UnityEngine.UI;

public class UIDragShrinkAndFall : MonoBehaviour
{
    [Header("Target UI Image to detect collision with")]
    public RectTransform targetRectTransform;

    [Header("Prefab to instantiate")]
    public GameObject prefabToInstantiate;

    [Header("Parent Transform for instantiated prefab")]
    public Transform prefabParentTransform;

    [Header("Snap Settings")]
    [Tooltip("Distance threshold to snap back to original position")]
    public float snapDistance = 15f;

    private RectTransform rectTransform;
    private Vector3 originalPosition;
    private bool isDragging = false;

    // Simulate gravity effect (modify as needed)
    private Vector3 velocity = Vector3.zero;
    public float gravity = -500f;

    void Awake()
    {
        rectTransform = GetComponent<RectTransform>();

        if (rectTransform == null)
        {
            Debug.LogError("This script must be attached to a GameObject with a RectTransform.");
            enabled = false;
            return;
        }

        if (targetRectTransform == null)
        {
            Debug.LogError("Target RectTransform is not assigned.");
            enabled = false;
            return;
        }

        if (prefabToInstantiate == null)
        {
            Debug.LogError("Prefab to instantiate is not assigned.");
            enabled = false;
            return;
        }

        if (prefabParentTransform == null)
        {
            Debug.LogWarning("Prefab parent transform is not assigned. Using current object's parent.");
            prefabParentTransform = transform.parent;
        }

        // Record original position on start
        originalPosition = rectTransform.anchoredPosition;
    }

    void Update()
    {
        // Here you should have your drag detection logic.
        // For demo, let's say left mouse button dragging over this rect triggers dragging.
        // (In your project, replace with your drag detection)
        CheckDragging();

        if (!isDragging)
        {
            // Apply simulated gravity
            velocity.y += gravity * Time.deltaTime;

            // Update position with velocity
            rectTransform.anchoredPosition += velocity * Time.deltaTime; //Severity	Code	Description	Project	File	Line	Suppression State	Details
            //Error(active)  CS0034 Operator '+=' is ambiguous on operands of type 'Vector2' and 'Vector3'  Assembly - CSharp E:\ss\Sample Station\Assets\UIDragShrinkAndFall.cs  75


            // Check if near original position to snap and disable gravity
            float distanceToOriginal = Vector3.Distance(rectTransform.anchoredPosition, originalPosition);
            if (distanceToOriginal < snapDistance)
            {
                rectTransform.anchoredPosition = originalPosition;

                // Kill gravity and velocity
                velocity = Vector3.zero;
            }
        }

        // Collision detection and instantiation
        if (IsRectTransformOverlapping(rectTransform, targetRectTransform))
        {
            GameObject ICO = Instantiate(prefabToInstantiate, prefabParentTransform);
            ICO.GetComponent<Image>().sprite = gameObject.GetComponent<Image>().sprite;
            ICO.name = gameObject.name;

            Destroy(gameObject);
        }
    }

    private void CheckDragging()
    {
        // Simple pointer check to fake dragging logic
        if (Input.GetMouseButtonDown(0))
        {
            // Check if mouse is over this rect transform 
            Vector2 localMousePos;
            RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, null, out localMousePos);
            if (rectTransform.rect.Contains(localMousePos))
            {
                isDragging = true;

                // When drag starts, kill velocity/gravity to allow smooth dragging.
                velocity = Vector3.zero;
            }
        }
        else if (Input.GetMouseButtonUp(0))
        {
            isDragging = false;
        }

        if (isDragging)
        {
            // Update position to mouse position in anchored coordinates
            Vector2 globalMousePos;
            if (RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)rectTransform.parent, Input.mousePosition, null, out globalMousePos))
            {
                rectTransform.anchoredPosition = globalMousePos;
            }
        }
    }

    // Checks if two UI RectTransforms overlap
    public static bool IsRectTransformOverlapping(RectTransform rect1, RectTransform rect2)
    {
        Rect rectA = GetScreenRect(rect1);
        Rect rectB = GetScreenRect(rect2);

        return rectA.Overlaps(rectB);
    }

    // Convert RectTransform to Screen Space Rect
    public static Rect GetScreenRect(RectTransform rectTransform)
    {
        Vector3[] corners = new Vector3[4];
        rectTransform.GetWorldCorners(corners);

        // Bottom-left and top-right corners in screen space
        Vector3 bottomLeft = RectTransformUtility.WorldToScreenPoint(null, corners[0]);
        Vector3 topRight = RectTransformUtility.WorldToScreenPoint(null, corners[2]);

        return new Rect(bottomLeft, topRight - bottomLeft);
    }
}