# How to flip just parent not child,How to only make parent flip not the child

I am making a platformer with a shooting mechansim. I followed the Blackthornprod tutorial (HOW TO MAKE A 2D RANGED COMBAT SYSTEM - UNITY TUTORIAL - YouTube) but after I wrote the script to rotate the weapon towards the mouse I noticed it also flips along with the player.

Here is the shooting script -

`````` Vector3 difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
float rotZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(0f, 0f, rotZ + offset);
``````

And here is the flip script -

``````//Player Horizontal Movement
float horizontalInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(horizontalInput * speed, rb.velocity.y);

rb.constraints = RigidbodyConstraints2D.FreezeRotation;

//flip player
if (horizontalInput > 0.01f)
{
transform.localScale = new Vector3(2, 2, 2);

}

else if (horizontalInput < -0.01f)
{
transform.localScale = new Vector3(-2, 2, 1);
flipHand = false;
}
``````

I did this on Unity version 2020.3.22f1

,I am making a platformer with a shooting mechansim. I followed the Blackthornprod tutorial (HOW TO MAKE A 2D RANGED COMBAT SYSTEM - UNITY TUTORIAL - YouTube) but after I wrote the script to rotate the weapon towards the mouse I noticed it also flips along with the player.

Here is the shooting script -

`````` Vector3 difference = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
float rotZ = Mathf.Atan2(difference.y, difference.x) * Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(0f, 0f, rotZ + offset);
``````

And here is the flip script -

``````//Player Horizontal Movement
float horizontalInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(horizontalInput * speed, rb.velocity.y);

rb.constraints = RigidbodyConstraints2D.FreezeRotation;

//flip player
if (horizontalInput > 0.01f)
{
transform.localScale = new Vector3(2, 2, 2);

}

else if (horizontalInput < -0.01f)
{
transform.localScale = new Vector3(-2, 2, 1);
flipHand = false;
}
``````

I did this on Unity version 2020.3.22f1