Comments and answers for "Rotating objects around other without rotating itself"
http://answers.unity.com/questions/1093789/rotating-objects-around-other-without-rotating-its.html
The latest comments and answers for the question "Rotating objects around other without rotating itself"Comment by Botcho on Botcho's answer
http://answers.unity.com/comments/1528293/view.html
Have you considered constantly refreshing the Quaternion.identity of the object?
//Rotate individual gem
radiusGems[i].transform.RotateAround(Vector3 point, Vector3.pivot, Quaternion angle);
//Constantly reset radiusGem[i]'s angle to 0,0,0
radiusGems[i].transform.rotation = Quaternion.identity;
Not sure how efficient it is to constantly reset the rotation.Thu, 12 Jul 2018 05:27:33 GMTBotchoAnswer by sajoga
http://answers.unity.com/answers/1096216/view.html
I just replied you and found the solution, but thanks anyway!
for (int i = 0; i < radiusGems.Count; i++) {
//radiusGems[i].transform.RotateAround(pivotSquare.transform.position, Vector3.forward, angle);
radiusGems[i].transform.position = RotatePointAroundPivot(radiusGems[i].transform.position,
pivotSquare.transform.position,
Quaternion.Euler(0, 0, angle));
}
....
public static Vector3 RotatePointAroundPivot(Vector3 point, Vector3 pivot, Quaternion angle) {
return angle * ( point - pivot) + pivot;
}Tue, 10 Nov 2015 14:43:02 GMTsajogaComment by toromano on toromano's comment
http://answers.unity.com/comments/1096185/view.html
Ok. What i suggested is actually doing what you asked for. $$anonymous$$eeps the local rotation unchanged, just rotating (translating) around the pivot . Here is another way to do it:
for (int i = 0; i < radius.Count; i++)
{
Vector3 pivotToRadius = radius[i].transform.position - pivot.transform.position;
radius[i].transform.position = pivot.transform.position + pivotToRadius * Quaternion.AngleAxis(difference * speed$$anonymous$$ultiplier, Vector3.forward); // speed$$anonymous$$ultiplier will smooth the rotation
}Tue, 10 Nov 2015 13:51:16 GMTtoromanoComment by sajoga on sajoga's comment
http://answers.unity.com/comments/1096172/view.html
I know what you mean, the problem is that I don't want to modify their local rotation while they are rotating around the center.
The rotation around the center is not inmediate.Tue, 10 Nov 2015 13:05:46 GMTsajogaComment by toromano
http://answers.unity.com/comments/1093984/view.html
Not a fancy way to do it but, you can simply get the rotation before RotateAround and set to the same rotation after RotateAround.
Quaternion rot = radius[i].rotation ;
radius[i].transform.RotateAround(pivot.transform.position, Vector3.forward, difference);
radius[i].rotation = rot;
Hope that helps.Thu, 05 Nov 2015 18:46:51 GMTtoromano