In FixedUpdate, I have canJump = Physics2D.OverlapBox(groundChecker.position, groundCheckerRadius, whatIsGround); However, even if the Box is not hitting anything, it gets set to true every frame.
I tested this also with an if statement and printing into console.
Layers are set correctly and the box is the size I want it to be as well. I checked with
I’m really desperate. Is this a bug or something? I can’t get a simple 2D Platformer Jump working… even if I copy the tutorial 1:1. And normally I already have some experience in Unity, also coding experience… I made some more complex things already… I don’t know what to do. Please help…
Thank you in advance for anything that might help!
There is no overload method which takes the layers on the third parameter. (I’m assuming your whatisGround is your layer selection and not an angle…)
On the top of this, the method is returning either a Collider2d or an int, never a bool (although the int may used as boolean but you really shouldn’t).