If a CollisionSound is provided in the Prefab, PhysicsGadgets will play said sound on collision. Currently, this is limited by the Gadget's velocity (doesn't play if less than 20f) and a timer (.3 seconds). Currently, the grenade_projectile.prefab has a Rust SMG sound stubbed in.
After some testing, the implementation is passable, however, I believe it could be improved:
The timer and velocity checks work for a baseline limit, however, I noticed times when the grenade would quickly bounce consecutively and not play a sound one of the bounces. I tried to make the velocity and timer checks laxer to improve this, however too lax causes the sound to play too often. One idea I have is to dynamically adjust the volume of the sound played, probably based on velocity, in combination with laxer checks, which would allow the sound to play more often while not flooding players' speakers.
In the same vein as the first, another idea I have is adjusting the timer check based on velocity. Currently, it's a set .3 second limit, however, I was thinking that the limit could be a higher value at low velocities (so it doesn't spam while the gadget is probably rolling) and a lower value at high velocities, as the gadget is likely to bounce/skip on the terrain anyways.
#211
If a CollisionSound is provided in the Prefab, PhysicsGadgets will play said sound on collision. Currently, this is limited by the Gadget's velocity (doesn't play if less than 20f) and a timer (.3 seconds). Currently, the grenade_projectile.prefab has a Rust SMG sound stubbed in.
After some testing, the implementation is passable, however, I believe it could be improved:
The timer and velocity checks work for a baseline limit, however, I noticed times when the grenade would quickly bounce consecutively and not play a sound one of the bounces. I tried to make the velocity and timer checks laxer to improve this, however too lax causes the sound to play too often. One idea I have is to dynamically adjust the volume of the sound played, probably based on velocity, in combination with laxer checks, which would allow the sound to play more often while not flooding players' speakers.
In the same vein as the first, another idea I have is adjusting the timer check based on velocity. Currently, it's a set .3 second limit, however, I was thinking that the limit could be a higher value at low velocities (so it doesn't spam while the gadget is probably rolling) and a lower value at high velocities, as the gadget is likely to bounce/skip on the terrain anyways.