I have a game where you control a ball (in 3D space) and it rolls down platforms.
I have certain blocks that bounce you up when you touch them. I desire to have a cooldown period after you touch the block so that it doesn’t immediately bounce you up again. I have done this in code by setting a boolean IsActive to false and then when that is false, you don’t get bounced up (velocity increased on the ball). The update loop decrements a timer and sets IsActive back to true once the timer expire so when you collide again, you get bounced.
The problem I have ran into is that my collision code is called from OnCollisionEnter() on the block. If the ball (player) jumps and lands back on the block and subsequently doesn’t move, OnCollisionEnter gets called when you first touch the block (while IsActive is false) but then not again after the cool down period ends.
I need some way of saying once the cool down is over, check if the ball and block are currently colliding. Any ideas how to accomplish this?