I have a children transform rotation set to (0,0,0) at start, I want to change it to (x,0,0) after I down a button, and back to (0,0,0) when I release it.
I did transform.Rotate(x,0,0); and it works, but transform.Rotate(0,0,0) doesn’t work for resetting it, it just keep adding up the x for some reason. How do I reset to it back to it default rotation? (note I’m only changing the x rotation relative to the obj location
transform.Rotate, how to say, is kind of a verb. It does something. I mean this function ROTATE something on a certain amount of degrees. When you say Rotate 0, nothing just happens, because it tries to rotate the object on 0 degrees. If you want to set up a specific rotation, then you should use:
transform.rotation = new Quaternion.Euler(x, 0, 0);
There should be an error, because it should not keep adding up the x, but adding just nothing. Thus, you have somewhere an error. I would suggest that it is in the IF statement, where you check the keyboard.