Help click and drag

Doubt

I have 10 objects on the screen, I need to select some of them in the mouse and clicking
drag and then say that the objects that they can only selected
control with the arrows.

can someone help me. ?

In the script on each object, define an OnMouseDown function that switches a boolean variable whenever the mouse is clicked:-

var movable: boolean;

function OnMouseDown() {
    movable = !movable;
}

Then, in the Update function, only activate the movement code when the “movable” variable is true:-

function Update() {
    if (movable) {
        var x = Input.GetAxis("Horizontal") * speed * Time.deltaTime;
        var z = Input.GetAxis("Vertical") * speed * Time.deltaTime;
        transform.Translate(x, 0, z);
    }
}

For the mouse button pressed to create an area of
check that it passes through the screen on some objects I to grasp what is selected

There’s an explanation of how to do this along with some code in this thread.

it serves if I click on the object I’m trying is to create a selection area with
the mouse button, and you enter this area will mark
It would be instead of passing the mouse over the object would be the selection area (as a
square or rectangle)