- Home /
How to make the player jump down from the platform
I am creating a endless runner game.i want to have the platforms such that when i swipe up,the player should pass through the collider of the platform and land over the platform and when i swipe down,the player should again pass through the collider and land down to the next platform below.
so first i have made all the platforms triggers true.and casted ray from below the Player,if the ray hits any of the platform the istrigger property of that platform is set to false.so that the player stands on the platform.
Another ray is casted from above the player so that when the player jumps with the swipe up,the ray on the top hits the platform above,triggers the collider of the platform so that the player passes through it and then the down ray detects the platform and makes the player stand on it.
Now when i swipe down, i want the player to pass through the platform below it,so i made the istrigger property of the below platform to true,but the problem is the rays are continuously casted and again they checkk that the rays are hitting something or not and again makes the trigger to false.
how can i get the swipe down functionality?
off top of my head.
you will need to get the ground object below player, and when swipe deactivate the collider so player falls through it.
can then reactivate it after x amount of time if you wanted