I am working on a 2D platformer, and when the box collider of my rigidbody character inches off the side, the “ontriggerexit” function is switched on, and the character shifts into the jumping pose. What script can I use to tell unity to preform such a command only when ALL of the character’s collision exits the collision it stands on??
here’s a video of what is happening: - YouTube
Here is my ontriggerexit/enter script:
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.tag == "floor"){
isgrounded = true;
}
}
function OnCollisionExit(theCollision : Collision){
if(theCollision.gameObject.tag == "floor"){
isgrounded = false;
}
}
just so you know, I have this script because if I dont, the character jumps into infinity. I use it so that the game knows when he is not grounded he cannot continue to jump. If you know a way around all this, let me know. Thanks!
EDIT: so I have a platform composed of a few 1 by 1 by 1 cubes. Apparently the on trigger exit function isn’t use to that or something, and thats why my character is acting up. well. that’s a bummer. the same problem doesnt occur on normal, longer platforms. strange…