In my game, I have made 4 lines with different colors to form a square but the colored lines are different objects. I want to rotate the lines in a way that the lines will still form a square. Eg:
But I'm only able to rotate them on the central axis, so, it forms a cross:
The code for leftPressed
is:
if(leftPressed)
{
black.rotation -= 90;
blue.rotation -= 90;
yellow.rotation -= 90;
red.rotation -= 90;
}
So, I need to know how to rotate objects on different axes.