Roated cude around Point with Respect to direction of Touch !!

This is video of which type of example i;m trying.

What exactly I’m want .as show in Video A cube is Rotating around a Point with Respect to touch Direction .

Here Is i have Three Type of Cube on Basics of Size ,Like 1x1x1 ,2x1x1 and 3x1x1 .

To achieve this Game Scene i had first Try to get a Direction of Touch . than On basics this Direction i make to

Rotating this’s cube But i;m not able to do This one.!! Guide Me . how should i go for it!

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).

Thanx Jesse ,

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 .

464510–16287–$Dir_move.zip (1.47 MB)

Is their any one ?

What does the .zip file that you posted contain?

This Zip have ma example code which i had implement .

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.)

Yes what i got in Debugging i’m not able to get current cube collider that why it Happen

for (currentKoob in koobArray){
Debug.Log("Is current Koob ");
// transform.Rotate(45,0,0);

if (pickedObject.collider == currentKoob.collider) {

var currentScript_LR : Koob_AI_LR = currentKoob.GetComponent(Koob_AI_LR);
Debug.Log(“LR collider”);
transform.Rotate(45,0,0);

//currentScript_LR.rotationSpeed = 2.0;

}

}

not Goes in If statment

Is there is anyone!

Hey Jesse , Are u Get ma problem ?

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.