Relative rotations

Hi, I’m trying to implement a code that does the following :
-Imagine a shape that has a 4 sides : Top, bottom, , left and right. Let’s assume we start with the bottom face facing us, when clicking on any face, said face will rotate so that it is now facing us.
While I’ve already implemented the whole “get which face you clicked on and start rotating”, I’m a bit confused as to how exactly I should code the rotation for it to look good.

My current code (using iTween) looks like :

iTween.RotateAdd(hitTransform.gameObject, iTween.Hash("amount", new Vector3(currentRotation.x + (currentRotation.x - 90F), 0F, 0f), "time", 1f, "oncomplete", "EndRotation", "oncompletetarget", this.gameObject));

Which is, as you can imagine, doesn’t work properly. What I want is basically to get the current rotation on the x.axis and then, depending on where I clicked, rotate towards it using the shortest path possible (and without rotating on any other axis)

Sorry if that isn’t clear, thanks a lot for your help!

It’s almost always going to be best to track your own notion of rotation angle, then tell iTween to tween the object to that rotation.

I would store the rotation in a float, then when it goes left and right, you set it to the new destination rotation by add/subtraction, and tell iTween to go do the work to update the visual representation.