Download

Marble Game - Ball Sound FX Logic

Hi, I’m currently working on a 3D marble obstacle course game. I’m a bit stumped trying to implement my sound FX event system. I know how to set up the rolling sound; velocity scaling the audio volume etc but I’m totally stuck trying to get a consistent ‘Hit’ event to fire whenever the ball bounces off a surface or glints an edge.

I’m currently using a physics enabled ball mesh, with angular rotation for motion.

I’ve tried using the Ball Mesh Hit Event but found it triggers repeatedly as soon as the ball starts rolling. I’ve had to create DoOnce gates with reset logic depending on whether the Hit Event is firing and various Velocity checks.

I’ve got a system set up using the Hit Events Impulse Normal to Vector Length XY values for horizontal impacts which appears to work.

But the Landing Impact event is proving difficult. It seems that even when I have the Balls physics material set to 0 restitution it still insists on bouncing twice. Is this normal? I’m also getting mixed results when a hit is registered on the Balls Linear Velocity Z, sometimes it’s a positive number and sometimes it’s negative on ‘‘weaker’’ bounces. This would be a lot easier if I could get the Hit Event to provide me with a zero’d out Impulse Normal for Z Axis. Then I could just get one vector length to do all my checks against.

Is there an easier way? Or am I heading in the right direction?

I’ve spent around a week tinkering with this and googling, so now I’m here. Help please :slight_smile: