Forum Discussion
Help with a storyline
Agreeing with Andrew, and adding that the real problem is knowing the stacking order of each block. The 'fit' is easy enough to manage with properly sized Legos and target zones. The stacking order of individual blocks can even be adjusted on the fly using the object().depth property. But, to know the order of the blocks relative to each other, you would have to track them manually as the user dropped them. It's doable, but takes a rather large number of triggers to account for all of the permutations. You would need some JavaScript attached to the drop triggers to adjust the depth of each block whenever one is dropped. This script would need the current order of the blocks on the screen to know if it should be above or below others.
You could potentially do it programmatically, tracking the x and y position of each Lego to determine if they on a target, and which target it is. Honestly, this would be the way to go, requiring far fewer SL triggers.
If you worked out the logic for position tracking, it would probably distill down into a fairly simple function that would keep all the Legos in the correct stacking order. The question is, is it worth the work it would take?