I’m trying to make a game in which… Is just an operating system, for fun
But then, I confront this problem, in which when I try to drag a window, it i’ll drag ALL OTHER instances of it, since in the code I programmed for only one part be draggable and the others will follow it.
Sorry if it was hard to understand, English is not my primary language.
I didn’t quite understood, but when I say that “it’ll drag all other instances”, I mean that when I create a new window and then drag that, all the elements are dragged with that new window, including the ones from the other one.
Maybe you can add variable to the object, and in the ‘WindowRight is being dragged’ add other condition SelectedWindow=“window1”.
You also need to add variable to the windowclose, windowminimize and windowmaximize etc.
If you have more than one window, each with their own minimize, maximize, etc. elements, it sounds like you’ll need to link each element to its matching WindowRight object (sorry I can’t recall the exact action name for this).
You need to use the ‘link two objects’- action and depending on the number of your elements several of them. You also need a ‘for each’- event since this is not applying only to one but potentially to a number of windows.
Here is a quick example (I just renamed the elements to make them fit better to your case). I can create these elements (or windows in your case) and drag them around without affecting other elements/windows. top is the part with the draggable-behavior attached.
I’d suggest that instead of linking the objects, use the Sticker extension and add the sticky behaviour to the keep the parts together. Then you just need the drag behaviour on the main part of the window. The sticky behaviour will keep the other window sections attached and in the right place.