I’m sure this is a very common game code, but I can’t seem to track anything down. I’m working on a bowling game and have attached a hit sound to the pins when they collide, but it’s always the same volume whether they are just plinking lightly together or getting bashed. It makes for incredibly unrealistic audio (here’s the sample: go to the end of the last alley and kick over the sample pins to hear it – https://playcanv.as/p/dBAIqENY/ )
So what do I attach to the script to change the sound volume based on the weight of the collision?
I would project the velocity vector along the collision normal to see how much of it is actually in the direction of the collision. That would give me an idea of whether it was a head on collision or just a glancing hit.