Little Update function troubleshoot ;

Hello guys,
I am getting mad about a problem that is compromising my scripting behaviour.

this simple code under Camera object;

void Update () {

if (activarotacionI == true) {
        
            activarotacionI = false;
            activarotacionD = false;
            float deltaAngle = 90f;
            Debug.Log ("ein");
}

yes the fact is that i was trying to rotate the camera in this script but i noticed the angles being rotated weren’t being calculated good. So the point is : when i execute code above I get 3 “ein” results… Its like frame 1 , 2 and 3 where launched simultaneous and don’t even noticed i switched the if statement off. As far i am concerned the Frame 1 Update function is done completely before Frame 2 Update function start… so I am expecting just ONE " ein " result and i don’t get why I got three of them… I posted this simple question because i forgot smething that seems very important on the code part of Unity and maybe this could help any other newbie coders.

Have you applied the component 3 times in the scene? 3 different objects, or one object 3 times

Oh no…

    void Update () {
    
    if (activarotacionI == true) {
          
                activarotacionI = false;
                activarotacionD = false;
                float deltaAngle = 90f;
                Debug.Log ("ein");

    }

You are missing a }

That if statement is empty at the moment. The compiler sees the lines under the if statement as just normal commands to be executed everyframe.

Change the code to:

    void Update () {
    
    if (activarotacionI == true) {
          
                activarotacionI = false;
                activarotacionD = false;
                float deltaAngle = 90f;
                Debug.Log ("ein");
    }
}

hello , i just solved and very sorry about you losing the time… I am saying the problem and the solution if any new coders uses as a tip.
The problem was what i told at the first post.
The thing is that the “activarotacionI” was fired to “true” by a button press… be aware guys of a button press or whatever action performed under update function, because it will run over and over until released. Counting 200fps a Left click can perform tons of update actions.
I just brute forced it by :

if (Input.GetKey (KeyCode.LeftArrow)) {
            if (flying == false){
                flying = true;
       
            activarotacionI = true;

            }
                }

And also in the update function i updated the rotation by this :

if (activarotacionI == true) {
            //enabled = false;
            deltaAngle = Time.deltaTime * 190f;
            activarotacionD = false;

            if ( currentRotationAngle > 90f )
            {
                activarotacionI = false;
                deltaAngle = 90f - currentRotationAngle;
                flying = false;
            }
            transform.RotateAround (Vector3.zero,Vector3.up, deltaAngle);
            lightus.transform.RotateAround(Vector3.zero,Vector3.up,deltaAngle);
            currentRotationAngle = currentRotationAngle + deltaAngle;

            Debug.Log (currentRotationAngle);
            if (currentRotationAngle == 90f){
                currentRotationAngle = 0;
            }
        }

everything seems work now ! thank you !