hi @Nitin - Welcome to the forum. They say the only dumb question is the one you don’t ask

Have a look at the PointerDragBehavior:

PointerDragBehavior | Babylon.js Documentation (babylonjs.com)

What you are trying to do can be changed by altering the `dragPlaneNormal`

. Hint Vector3(0,1,0) is Vector3.Up(), which is ground dragging, so just change that accordingly.

Next you will want to add also a `validateDrag`

. It may end up looking something like this:

```
const validateDrag = (targetPosition) => {
return Math.max(Math.abs(targetPosition.x), Math.abs(targetPosition.z)) <= (GROUND_SIZE / 2) - 10;
}
```

You can see a working example here, although it is not an imperative example you can always work backwards but for restricting drag the above validation is used and you cannot drag the meshes outside of the ground:

Behaviors - Drag ‘n’ Drop ⋅ Storybook (brianzinn.github.io)

I did something like that recently to do exactly what you are doing, which was drag a window in a wall. That snippet is here:

```
const dragBehaviour = new PointerDragBehavior({
dragAxis: new Vector3(1, 0, 0),
});
dragBehaviour.useObjectOrientationForDragging = true;
dragBehaviour.onDragObservable.add((event: {
delta: Vector3;
dragPlanePoint: Vector3;
dragPlaneNormal: Vector3;
dragDistance: number;
pointerId: number;
}) => {
setVersion((v) => v + 1);
xShift.current += event.delta.x;
});
dragBehaviour.validateDrag = (targetPosition: Vector3) => {
return Math.abs(targetPosition.x) < 1;
}
dragBehaviour.attach(mesh)
```