I am using a character controller and after the character controller double jumps if you press jump a third time he does an “air smash.” Kind of mario style. If the ground is visible it works fine. But if I can’t see the ground below the character he will perform the air smash but will not detect a collision when he hits the ground and therefore goes right through the ground… I’m stuck trying to figure out why. My script is very long so here is the bits pertaining to what I’m trying to accomplish.
if (!airSmashing) {
collisionFlags = controller.Move (direction * speed + Vector3 (0, verticalSpeed, 0) + inAirVelocity;);
}
if (airSmashing) {
canControl = false;
controller.Move (Vector3.down* 100 * Time.deltaTime);
if (controller.isGrounded) {
airSmashing = false;
canControl = true;
}
}
Any suggestions?