My Character isnt Flipping properly....HELP!

Hello Community,

Firstly I am very new to coding and working on a 2d game, my character doesn’t flip around to face the direction i want to go.

So in my 2d game I want my character to look left when pressing left and look right when pressing right, at the moment my character will flip but only after a jump command which has completely confused me.

[/code]

using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using UnityEngine;
public class playerMovement : MonoBehaviour
{
public float speed;
public float jump;
private float move;
private Rigidbody2D rb;
private bool isJumping;
bool facingRight = true;
public Animator animator;
// Start is called before the first frame update
void Start()
{
rb = GetComponent();

}
// Update is called once per frame
void Update()
{
move = Input.GetAxisRaw(“Horizontal”);
animator.SetFloat(“Speed”, Mathf.Abs(move));
rb.velocity = new Vector2(move * speed, rb.velocity.y);
if (Input.GetButtonDown(“Jump”) && !isJumping)
{
rb.AddForce(new Vector2(rb.velocity.x, jump));
isJumping = true;
}
}
void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag(“Ground”))
{
isJumping = false;
}
if (move < 0 && facingRight)
{
flip();
}
else if (move > 0 && !facingRight)
{
flip();
}
}
void flip()
{
facingRight = !facingRight;
transform.Rotate(0f, 180f, 0f);
}

}[/CODE]

If you’re going to post code on the forums please use code tags to make it readable: Using code tags properly

Second, You’ll have to explain exactly what behavior you’re looking for. You said your character doesn’t flip to face the direction you want, but you haven’t explained what that direction is or when you want the flipping to happen. It’s hard to help without knowing that information.

Hiya thanks for explaining the forum rules! I’ve hopefully edited my post accordingly