Rotate a 2D sprite without rotating the transform

Oddly I find a lot of answers for the opposite problem, but in this case I’d like to rotate the 2D sprite without changing the collision.

You want to rotate the sprite, without rotating it’s collider? If so, you could just create an empty gameobject, put the collider on it, and make the sprite a child of it. The sprite could rotate all it wants, and the collider would remain on the parent object, not moving.

If you’d just like to have the collider not change, you could try:

  1. Create an empty game object

  2. Add a collider component to the game object (the same collider that you’d use for the sprite)

  3. Delete the collider component from the game object that has your sprite

  4. Parent the sprite game object to your collider game object (So the sprite is the child)

Now if you rotate the sprite’s transform, the collider won’t rotate (because it’s on a separate object). If you move the collider, the sprite will move with it.

The answer was already given but I’ll give my own anyway.
I searched for this issue and the answer was not what I was exactly looking for ,I.E. in my case anyway.

I currently build a classic space-shooter and I made some enemy space ship sprites.
The the sprites have the enemy looking “up” which is the opposite direction of the player that is position at the bottom.

Since I only need to change rotation of the sprite itself, I thought maybe Unity had the tools to do some basic editing to the sprites such as rotating the image itself and replace the old with the new.
No such feature was found in my case, which is why I resorted to use a simple image editor.

@ozcomingfroo_unity
In the sprite properties, there is check-box for vertical flip. It flips picture, not game object itself.
notice: 180° rotation = vertical filp + horizontal flip

,is not there check-box for vertical flip in sprite properties ? I have not editor juset here, but i im sure, this option was there.

@ozcomingfroo_unity
In the sprite properties, there is check-box for vertical flip. It flips picture, not game object itself.
notice: 180° rotation = vertical filp + horizontal flip