I am trying to rotate a pygame sprite towards the mouse by running
mouseX, mouseY = pygame.mouse.get_pos()
direction = pygame.math.Vector2(mouseX, mouseY) - self.rect.center
angle = direction.angle_to((0, -1))
self.image = pygame.transform.rotate(self.image, angle)
but that is just changing the sprites scale and rotation is happpening? the code on other questions was simmilar and running that too gave me no roation but changing the scale of the sprite
please help!