Hello.
I was hoping someone might be able to suggest a neat and clever way of preventing my collision sounds from ‘stuttering’ to a halt. I have a physics object (a ball) that collides with other objects and these objects trigger an event sound when the ball collides with them.
local function objectCollision( self, event )
if ( event.phase == "began" ) then
if (event.other.name=="ball") then
media.playEventSound( sound )
end
end
end
object.collision = objectCollision
object:addEventListener( "collision", object )
But the thing is; I want to be able to set a time limit on how often a collision can trigger a sound to stop glitchy tight audible repeats. I don’t want to weigh my code down with creating a timer to toggle a boolean on each collision.
Any suggestions? [import]uid: 62617 topic_id: 20242 reply_id: 320242[/import]