This is supposed to make an object turn 90 degrees each time the player hits the right arrow key.
The outcome is that it makes it turn, until it hits 180 degrees, and then it doesn’t move at all. I don’t know whats wrong with my code.
if (Input.GetKeyDown("right")){
selectionArea.transform.rotation.y += selectionArea.transform.rotation.y = 90.00 * Time.deltaTime;
}
You have to use Eular angels to perform such rotations (Although I would actually suggest you use Quaternions).
if (Input.GetKeyDown("right")){
selectionArea.transform.rotation *= Quaternion.Euler(0,1 * Time.deltaTime,0);
//Sorry I am not quite sure what you are trying to do with your function.
}