Hello, currently I’m having issues getting OnCollisionStay2D to run each frame. My character isn’t moving and it is constant collision with the ground, and yet, every few frames or so, the collision check just doesn’t seem to run. It is kind of important because I need to check if I’m on the ground before I jump, but occasionally the jump will fail because the collision check doesn’t get run and the groundcheck boolean remains set to false. Anyone know how to fix this?
Here’s the code and the output I got for testing this-
bool ran = false;
void LateUpdate()
{
if (ran)
Debug.Log("Wall checks were run");
else
Debug.Log("Wall checks not run");
ran = false;
}
void OnCollisionStay2D(Collision2D coll)
{
ran = true;
}