"OnDrag" not getting the "EndPointWorldPose" values continously

Hi,
I am having two cubes in a bar I have attached draggable script in the cubes. while moving the cubes if the distance between the cubes is 0.5m I have to stop the user in moving the cubes lesser than 0.5m distance. my problem is if I am moving the cubes slowly there is no issues and if I am moving the objects fastly my objects is going lesser than 0.5m.

public void OnDrag(PointerEventData eventData)
{

        ZPointerEventData pointerEventData = eventData as ZPointerEventData;
        if (pointerEventData == null || pointerEventData.button != PointerEventData.InputButton.Left)
        {
            return;
        }

        Pose pose = pointerEventData.Pointer.EndPointWorldPose;

        float v = Vector3.Distance(Lballoon.transform.position, Rballoon.transform.position);

        //Debug.LogWarning(v);
        
            if (v <= 0.5f)
            {
                if (activeDrag)
                {
                    activeDrag = false;
                    maxdis = pose.position.x;
                    Debug.Log("MxDis Set " + maxdis);
                }
            }

            float clampValue = Mathf.Clamp(pose.position.x, -1.11f, maxdis);

           this.transform.position = new Vector3(clampValue, this.transform.position.y, this.transform.position.z);
    }

I do not see a problem with OnDrag or EndPointWorldPose. You will need to explain in much more detail or write a script that clearly exposes the issue. The snippet you have shared does not do so.

With regard to your separate issue about objects reaching proximities closer than 0.5, your script does not explicitly prevent this.

Here is a script that does.

    public void OnDrag(PointerEventData eventData)
    {

        ZPointerEventData pointerEventData = eventData as ZPointerEventData;
        if (pointerEventData == null ||
            pointerEventData.button != PointerEventData.InputButton.Left)
        {
            return;
        }

        Pose pose = pointerEventData.Pointer.EndPointWorldPose;

        // "this" is the same as Lballoon
        float maxDistanceToRightBalloon = 0.5f;
        float minWorldDistance = -1.11f;

        float clampValue = Mathf.Clamp(pose.position.x, minWorldDistance,
            Rballoon.transform.position.x - maxDistanceToRightBalloon); ;

        this.transform.position = new Vector3(clampValue,
            this.transform.position.y, this.transform.position.z);
    }

Yes this logic works Thanks you @Alex