diff --git a/Assets/Scripts/Guns/Gun.cs b/Assets/Scripts/Guns/Gun.cs index eaaf61d..ce1c4a7 100644 --- a/Assets/Scripts/Guns/Gun.cs +++ b/Assets/Scripts/Guns/Gun.cs @@ -20,6 +20,12 @@ namespace Saltosion.OneWeapon.Guns { private Bullet CurrentBullet; private bool HasShotBullet = false; + private float BulletHoleOriginalY; + + void Start() { + BulletHoleOriginalY = BulletHole.localPosition.y; + } + void Update() { if (CurrCooldown > 0) { CurrCooldown -= Time.deltaTime; @@ -66,6 +72,11 @@ namespace Saltosion.OneWeapon.Guns { public void FlipGun(bool flipped) { Sprite.flipY = flipped; + float y = BulletHoleOriginalY; + if (flipped) { + y = -y; + } + BulletHole.localPosition = new Vector2(BulletHole.localPosition.x, y); } } }