Cocos Creator 3.7.0 how to rotate 2D object by certain angle?

Hi all, I am trying to rotate 2D object to the input position using standard angle calculation function, but I don’t know why, I can’t rotate it more than 90 and -90 angle, it just starts to rotate in opposite value.
Maybe I am using the wrong method to assign angle?

Here is the video ang my code:

update(dt: number) {
        const { node } = this;

        node.angle = angleTest;

        angleTest++;

        console.log(angleTest);
     }
}

You can see the implementation of this demo

wanna cry - Weird behaviour of 'rotateBy' starts from CC 2.3 =)

If I understood correctly, I need to fix angle after certain values? for example, if it above 90 - do minus 360 of it?

The reason for subtracting 360 is to avoid counting errors due to excessive calculations caused by large angles. This is because the angle of the circle is between 0 and 360

but in my case it starts to rorate to different direction after angle 90

NewProject_1.zip (3.9 MB)
I used this to run a test and it was fine. You test with this demo first, if there is a problem, help me to change it, thanks

1 Like

Thanks, I don’t know what was in my case presented in video. I created new project, try to change angle and everything ok. Sorry.