hello everyone.
i am trying to rotate a square. for that i used below code.
square.rotation = 90;
this is working fine. But it is working just on one single click..once i have clicked on it it'll rotate. but if i click on it second time it is not rotating.
so how can i do this. can anyone tell me how to do this??? ![]()
The reason it only worked once is because you were assigning it a fixed value unstead of changing the value each time...
square.rotation = 90;
tells its rotation value to be 90 degrees. After you reach it the first time, it is at 90 degrees all the time after that. Instead, to have it change by 90 degrees each time...
square.rotation += 90;
North America
Europe, Middle East and Africa
Asia Pacific