i made a script to check for grounded
currentY = transform.position.y;
if (currentY == lastY) {
grounded = true;
print ("grounded");
} else if (currentY != lastY)
grounded = false;
print ("not grounded");
lastY = currentY;
when i test it, it prints grounded and not grounded simultaneously when the player is not moving, whilst the player is falling it prints not grounded more but still prints grounded as well. what could be causing this?