I want to make something seemingly simple by having a crash sound play when the player bumps into anything above a certain speed.
I managed to set up some nodes that succesfully plays the sound when the player smashes into a wall, and doesn’t if it gently taps it.
However, the problem I’m still facing is if the player slides off or scrapes by an object, it also starts playing the crashing sound a trillion times as soon as the sliding speed goes over the limit, since the engine doesn’t differentiate a hard frontal hit from simply touching.
I’m looking for a way to only have the crash sound play if the player hits the object within a certain angle perpendicular to the surface that it is hitting. So far the documentation has been left to be desired, and I can neither find any info on this elsewhere.
I’d guess that the Hit Normal from the Event Hit node could be involved with this, but I can’t seem to make too much sense of it yet, if it’s even related at all.
Thank you very much! That was exactly what I needed. I was not familiar with the Dot product node yet.
Now if I slam into anything it correctly plays the crashing sound. Yet if I slide over an object at speed it keeps silent unless I hit another obstacle along the way.