How can I make something stop moving when its at another item's vector3?

I’m trying to get a capsule (named “chars[0]” below) to move when I click, and stop when it reaches the target. The target is a sphere that follows your mouse, but when the capsule reaches it, it doesn’t stop.
Here is my code:

{

public Vector3 placement;

public Vector3 charsPlacement;

public GameObject[] chars;

public GameObject self;

public moving otherBool;

// Start is called before the first frame update
void Start()
{

    placement.y = 1f;

    Cursor.lockState = CursorLockMode.Locked;

    placement.x = 0f;

    placement.z = 0f;

    GameObject g = GameObject.FindGameObjectWithTag("ActiveCharacter");

    otherBool = g.GetComponent<moving>();

}

// Update is called once per frame
void Update()
{

    placement.x += Input.GetAxis("Mouse X");

    placement.z += Input.GetAxis("Mouse Y");

    transform.position = placement;

    if (Input.GetMouseButtonDown(0))
    {

        placement.y = 1f;
        chars[0].transform.LookAt(self.transform.position);
        otherBool.move = true;
        Cursor.lockState = CursorLockMode.None;

    }
    
    
    if (transform.position == chars[0].transform.position)
    {

        otherBool.move = false;

    }

}

}

The code for the capsule:

{

public GameObject self;

public GameObject target;

public Vector3 targetLocal;

public bool move = false;

public float speed = 1f;

void Start()
{
    
}

// Update is called once per frame
void Update()
{
    if (move)
    {

        speed = 5f;
        self.transform.position += transform.forward * Time.deltaTime* speed;
        
    }
    if(!move)
    {

        speed = 0f;

    }
}

}

(Im sorry im still kind of new, so Im not sure what’s wrong so I added it all)

Does anyone have any ideas?

I think the problem comes from how you tell if the capsule has reached the destination. (More specifically, the transform.position == chars[0].transform.position part) Since the capsule has a good amount of speed, it will always overshoot its destination while moving, meaning the two positions will never be exactly the same. You should use a condition like this instead:

if (Vector3.Distance(transform.position, chars[0].transform.position) < stopDistance) // where stopDistance is a small number, such as 0.01f

And then things should work as expected.