I’ve recently stumbled upon this problem. Somehow the OnTriggerEnter doesn’t seem to be working, therefore not changing the OnGround variable to true.
https://drive.google.com/file/d/1A0grOZtWTm077ysrqYusChT4kiV1zd8n/view?usp=sharing
Maybe add a Debug.Log to see if your collider is colliding at all? Maybe the ground is missing the “ground” tag? Maybe the tag is spelled wrong? There are any number of things that could be happening.
Just a tip, it’s better to post more code and/or screenshots in the post itself instead of having a google drive link so people can answer the question without having to download your whole project
You need to use OnTriggerEnter2D not OnTriggerEnter (thats for 3D). Also, make sure the object’s collider is set to trigger. And do as japhib says, add some debug.logs, those are your best friend.
Thanks! I didn’t know there was a 2D version of Trigger and Collider events.
The ground tab was working and the collider should be working since it wouldn’t be colliding if it wasn’t.
Thanks for the tip though. I’m kind of new in this community.