Player Controller (2D platformer)

I have some code that controls double jumping and which keys you must use to move left/right and jump, i have made it so when a player is on the ground he/she is allowed to press space bar twice to trigger and double jump, my problem is that if a player jumps onto a platform that is off the ground it only allows one jump because the player must move back down to the ground off the level for the code to be able to detect the ground check.

(Sorry if this isn’t explained to well I’m kinda new to coding but heres an example off what i mean in a picture) Screenshot by Lightshot when the player is on the grass area which is the floor of my level they are allowed to jump twice for a double jump but once they jump onto an object thats off the ground or slightly off the ground it only allows one jump and then won’t allow them to jump again.

and here’s my code i use if needed using UnityEngine;using System.Collections;public class PlayerController : - Pastebin.com

I suspect your base ground and platforms are on two different layers. When selecting either, look up to the right in the inspector and you’ll see the name of the object, its tag, and its layer.

Your Physics2D.OverlapCircle is only checking “whatisground”. Unless the platforms are set to that as well, your physics component won’t register it.