i am trying to make a wall jump, but when on the wall it does not always jump, only sometimes. please help it is inconsistant on both sides Code (CSharp): public class WallJump : MonoBehaviour { [SerializeField] private LayerMask groundLayerMask; public BoxCollider2D boxCollider2D; public Rigidbody2D rb; public GameObject playerController; // for checking if wall jumped so you wont wall slide right after bool wallJumpedFromRight = false; bool wallJumpedFromLeft = false; //i right and i left int iR = 0; int iL = 0; // Update is called once per frame void FixedUpdate() { if (CheckIfOnWallToRight() == true) { // make you jump of the wall if ((Input.GetButtonDown("Jump")) && (Input.GetButton("d"))) { playerController.GetComponent<PlayerMovement>().enabled = false; rb.velocity = new Vector2(-5, 10); wallJumpedFromRight = true; } // makes you wall slide else if ((Input.GetKey("d")) && (wallJumpedFromRight == false)) { rb.velocity = new Vector2(0, -1); Debug.Log(wallJumpedFromRight); } } if (wallJumpedFromRight == true) { iR += 1; } if (iR >= 25) { iR = 0; wallJumpedFromRight = false; playerController.GetComponent<PlayerMovement>().enabled = true; } else if (CheckIfOnWallToLeft() == true) { if (Input.GetButtonDown("Jump")) { Debug.Log("wd"); } // make you jump of the wall if ((Input.GetButtonDown("Jump")) && (Input.GetButton("a"))) { playerController.GetComponent<PlayerMovement>().enabled = false; rb.velocity = new Vector2(5, 10); wallJumpedFromLeft = true; Debug.Log("wall jump l"); } // makes you wall slide else if (Input.GetKey("a") && (wallJumpedFromLeft == false)) { rb.velocity = new Vector2(0, -1); Debug.Log(wallJumpedFromLeft); } } // to give the player back control if (wallJumpedFromLeft == true) { iL += 1; } if (iL >= 25) { iL = 0; wallJumpedFromLeft = false; playerController.GetComponent<PlayerMovement>().enabled = true; } } here is the raycast for the checking of being next to a wall. just incase, but it is says it is green the whole time so i doubt it Code (CSharp): public bool CheckIfOnWallToRight() { // send a ray to tell if you are touching/near a wall RaycastHit2D onWallRight = Physics2D.Raycast(new Vector3(boxCollider2D.bounds.max.x + .1f, boxCollider2D.bounds.max.y, 0), Vector2.down, .55f, groundLayerMask); // sets ray color depending on if you are near a wall or not Color rayColor; if (onWallRight != true) { rayColor = Color.red; } else { rayColor = Color.green; } // shows the ray... as close as i can, why cant they just make it so there is a thing to show the ray? that //would make it much easier. Debug.DrawLine(new Vector3(boxCollider2D.bounds.max.x, boxCollider2D.bounds.max.y - .02f, 0), new Vector3(boxCollider2D.bounds.max.x, boxCollider2D.bounds.min.y + .02f, 0), rayColor); return onWallRight; } // check to the left public bool CheckIfOnWallToLeft() { // send a ray to tell if you are touching/near a wall RaycastHit2D onWallLeft = Physics2D.Raycast(new Vector3(boxCollider2D.bounds.min.x + -.1f, boxCollider2D.bounds.max.y, 0), Vector2.down, .55f, groundLayerMask); // sets ray color depending on if you are near a wall or not Color rayColor; if (onWallLeft != true) { rayColor = Color.red; } else { rayColor = Color.green; } // shows the ray... as close as i can, why cant they just make it so there is a thing to show the ray? that //would make it much easier. Debug.DrawLine(new Vector3(boxCollider2D.bounds.min.x, boxCollider2D.bounds.max.y - .02f, 0), new Vector3(boxCollider2D.bounds.min.x, boxCollider2D.bounds.min.y + .02f, 0), rayColor); return onWallLeft; } }