Is there a way I can use one trigger box with many events in a blueprint?
for example, I want the same trigger box to trigger more than two sounds independently from each other within a blueprint.
To clarify let me bring you to the scenario I have:
I have a Car Blueprint that has a mesh and a complex collider. The player can bump it or fire a gun and hit it. two different actions, two different sounds. If I use the “onComponentHit” for the first case then I can not use it anymore. How I can work around this problem?
What’s the logic? How does the system know when you want soundA or soundB?
That is what I am trying to understand mate. Is there a way to use one trigger box for different sounds?
That’s for you to decide. For example, randomly
Ah, I didn’t see part of your description ( was it there before? ).
The object hitting it needs to send a message telling the car what kind of hit is is.
Or, the thing doing the hitting plays the right sound for the kind of hit it’s making.
you can make a blueprint interface and implement the interface to every object that collides and must make some sound.
Then you make a function implementation for the interface like give me your sound ID and the functions sends an integer as the Sound Index.
Then you can have all your sounds in an array and use like this:
onBeginOverlap—>does implement interface “noisy item” ? ----> true ----> call interface “give me your sound ID” (returns an integer) ----> playsound ( array [ sound ID ] )
sorry for the pseudo code
the interface function:
you must add the interface in each object that emits sound in class settings section
and implement the function
then in the main actor do this: