Page 1 of 1

Play roll sound when rolling and bounce sound when bouncing

Posted: Thu Feb 27, 2014 8:45 am
by somebodyelse
How do you know when the Ball is rolling on the ground? I have tried numerous things but they are not accurate. I want to play a bounce sound when the ball bounces, but when it is rolling, I want to play a rolling sound.

I have tried checking current.y == last.y but this doesn't work properly because if you bounce on an angle (not straight up and down) many times the ball will stay on the ground for an unnoticeable amount of time which causes it to play the rolling sound which it shouldn't.

Re: Play roll sound when rolling and bounce sound when bounc

Posted: Thu Feb 27, 2014 9:08 am
by Azhukar
somebodyelse wrote:How do you know when the Ball is rolling on the ground? I have tried numerous things but they are not accurate. I want to play a bounce sound when the ball bounces, but when it is rolling, I want to play a rolling sound.
For bounce you could determine the impact force and adjust sound accordingly.

Rolling sound could be based on velocity and play only when touching ground.