Good evening to all,
I’m trying to rotate several blue cubes (joined together) around the center, and I’m doing the same with a plane and another single cube (white).
The 5 cubes are related to a parent cube (Pent Cube) and the latter is connected to a rigidbody.
The problem comes when I want to rotate the blue cubes.
I click on the left capsule (to rotate the plane, the white cube and the 5 blue cubes).
The problem is that the blue cubes seem to be attracted by the left capsule which says to turn 90°, here is the code:
void OnMouseDown()
{
plane.transform.RotateAround(Vector3.zero, Vector3.up, 90f);
whiteCube.transform.RotateAround(Vector3.zero, Vector3.up, 90f);
pentCube.transform.RotateAround(Vector3.zero, Vector3.up, 90f);
Normally the blue cubes should rotate 90f inside the plane (and not on the capsule), like the white cube does.
And here is a video to better understand:
Thank you all for your help.
A+