How would you go about flipping the "bullet" sprite?

Since the included character spritesheet came with a bow firing animation I decided to use that animation and draw an arrow as my “bullet”.

I want my arrow to be facing the correct direction when fired so I was wondering if there was a way to flip it using the instantiate parameters? I noticed the last parameter is for rotation, could I use this rotation parameter to rotate it 180 degrees? Maybe I’m overthinking this and there’s a simpler solution.

In the meantime I achieved my desired result by creating 2 separate prefabs, one is a “left arrow” and one is a “right arrow”


Code_LM5wAUM69P

1 Like

Hi Vandole,

Using two different prefabs is a good solution but since you asked if there was a way to flip the sprite via code: Yes, there is. You could also try to use SpriteRenderer.flipX. (Access the SpriteRenderer object, then access flipX.)

Did this help?


See also:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms