I can’t get my head around what I exactly to write, so only my gun rotates.
Can anyone help?
parts of script that do flip
[SerializeField] Transform gun;
private void CheckDirection()
{
if(isFacingRight && moveHorizontal < 0)
{
Flip();
}
else if(!isFacingRight && moveHorizontal > 0)
{
Flip();
}
}
private void Flip()
{
isFacingRight = !isFacingRight;
transform.Rotate(0f, 180f, 0f);
}