[quote:hi77516l]I didn't state this properly in my original post (so my fault), but the blocks should be able to moved multiple times and reordered (so it could be green, red, purple, yellow, blue, etc). From what I presume you said, this would fix the objects to a container.
Might be me that misunderstood your pictures, it looks like what you wanted was as the boxes are placed on the scale that the scale should be animated so the heavier boxes tip the scale.
If that's the case, then the objects will only be temporarily fixed to the scale so they line up with the animation, and then unfixed as a new box is move to the dotted area to replace it. The pin behaviour allows you to do this.
[quote:hi77516l]What I would love help to implement is how to make objects switch positions. When a box moves into a container that has a box in it, it needs to send the box that was there to the container the new box came from, so their places 'switch'. I put a note in the .capx.
You can do that by changing and adding a few things to what I wrote.
1. If you added the variable called "color" you can remove that.
2. To the boxes that you move around you add a variable called "Container_UID" which will hold the UID of the container where the box is currently placed. (You just initialize these from the start in C2 design mode according to where they are placed and then as the boxes are moved around you overwrite them get overwritten)
3. As you start moving a box you save this "Container_UID" in a global variable.
4. By doing that you can then use this variable both when a box is dropped outside the scale and when you need to replace a box.
Event: Start moving box
On DragDrop of box
Action:
Set <Global variable> = Box.Container_UID
Event: Replace and return box
If Box is overlapping Dotted box
If Box is overlapping Another box
DragDrop on released
Pick bottom box (This is why you move the one you are dragging to the top, so its always the one already in the dotted box that gets returned)
Action:
Box disable pin to object behaviour. (This will make sure that the box that are returned doesn't follow the scale as it moves.
Sub event to "Replace and return box": Return the bottom box
Pick Container where UID = <Global variable> (Will pick the container from where you took the box)
Set Box position to Container
Box.Container_UID = Container.UID (This will store the Container.UID with the box, so next time you move it, you again know where you took it from)