How can I fix that they are existing?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float WallDownForce;
public float speed;
public float jumpForce;
private float moveInput;
private Rigidbody2D rb;
private bool facingRight;
private bool isGrounded;
public Transform groundCheck;
public float checkRadius;
public LayerMask whatIsGround;
private bool onWall;
public Transform wallCheck;
public float WallCheckRadius;
public LayerMask whatIsWall;
private int extraJumps;
public int extraJumpsValue;
// Start is called before the first frame update
void Start() {
extraJumps = extraJumpsValue;
rb = GetComponent();
facingRight = true;
}
void FixedUpdate() {
Flip(Horizontal);
onWall = Physics2D.OverlapCircle(wallCheck.position, WallCheckRadius, whatIsWall);
isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);
moveInput = Input.GetAxis(“Horizontal”);
rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
}
void Update(){
if(isGrounded == true){
extraJumps = 1;
}
if(onWall == true){
extraJumps = 1;
}
if(Input.GetKeyDown(KeyCode.Space) && extraJumps > 0){
rb.velocity = Vector2.up * jumpForce;
extraJumps–;
}else if(Input.GetKeyDown(KeyCode.UpArrow) && extraJumps == 0 && isGrounded == true){
rb.velocity = Vector2.up * jumpForce;
if(Input.GetKeyDown(KeyCode.Space) && extraJumps > 0){
rb.velocity = Vector2.up * jumpForce;
extraJumps–;
}else if(Input.GetKeyDown(KeyCode.UpArrow) && extraJumps == 0 && onWall == true){
rb.velocity = Vector2.down * WallDownForce;
}
}
void Flip(float Horizontal)
{
if (Horizontal > 0 && !facingRight || Horizontal < 0 && facingRight)
{
facingRight = !facingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}
}
}