Just to keep folks from duplicating their efforts, I’ll link to your cross- and duplicate posts here, here, and here.
As for your question, I gather you’re asking how to implement the behavior shown in the video, but with different sized blocks?
If so, here’s a couple tips:
Don’t use the physics system for this; instead, manipulate the block transforms directly.
Don’t use relative transformations or manipulate the transforms in a way that could lead to accumulated numerical error; instead, make the behavior deterministic by specifying the new position and orientation for the block on each move, and then interpolating/animating from the previous transform to the new transform.
To determine the requested direction of movement, just check the angle of the swipe against the four quadrants of the unit circle, offset by 45 degrees (and perhaps also offset to match the 3/4 view).
Regarding the animated motion of the blocks, I’d probably handle that by manipulating the transform directly and computing the intermediate transforms using vector math and trig. That’s not the only way you could do it though (you could probably use animations as well).
Well first i had implement for 2 cube with same size bt i can not able to uniquely identify the cube if is rotated one cube it rotating all cube together .
If it’s just source code, perhaps you could post it here (or link to pastebin or whatever).
If it’s a lot of code though, you might be better off narrowing things down and/or doing some debugging yourself first so that you can ask a more specific question. (What you describe - that ‘all the cubes are rotating together’ - is a pretty general problem, and could be caused by any number of things.)
I don’t know how much further help I can offer. I’m having some difficulty understanding your questions, and I’m still not entirely sure what problem you’re trying to solve.
A couple of tips though. First, be sure to use ‘code’ tags when posting code (and make sure the indentation is preserved). Also, you might want to post a little more than what you posted, so that we can see the context (for example, we don’t know where ‘pickedObject’ comes from, so it’s hard to say what’s wrong based on what you posted).
If you can provide some more clear info, someone might be able to help you in this thread. If what you’re needing though is more in the way of one-on-one technical support or assistance, you might try the ‘Collaboration’ forum instead.