Code ignores a line for no discernable reason

Godot Version

4.5.1.stable

Question

For some unholy reason, a line seems to just be ignored. The line of code which it’s used for just doesn’t work. Here’s the code:

		var currentshot = Vector2(0,0)
		currentshot.x = targetx - global_position.x
		currentshot.y = targety - global_position.y
		currentshot = currentshot.normalized()*3
		currentshot.rotated(PI/18)
		print(currentshot.angle())
		currentshot.rotated(-1*cycle*PI/90)
		print(currentshot.angle())
		for n in 2:
			glo.bulletvector = currentshot.rotated((PI/10)-(n*PI/5))
			print(glo.bulletvector.angle())
			var shotinstance2 = bulletbullet.instantiate()

For some reason, the second rotation simply fails to go through. I tried having it be part of the first rotation, but no dice. The problem persists regardless of the situation of the cycle variable.

I inserted the line into the glo.bulletvector call, and it worked there perfectly fine. My code is functional now, but I’d still really like to know what the hell happened.

Vector2.rotated() calculates and returns the rotated vector, but it doesn’t change its original vector. If you want to change it, you have to assign the result back into the variable.

		currentshot = currentshot.rotated(PI/18)
		print(currentshot.angle())
		currentshot = currentshot.rotated(-1*cycle*PI/90)
		print(currentshot.angle())

… I might be stupid.