Announcement

Collapse
No announcement yet.

Looking to find where/how to attach collision sounds to static mesh/objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Looking to find where/how to attach collision sounds to static mesh/objects

    Hi Unreal community,

    Here's what I'm looking to do:

    Find the place/file where I can assign collision sounds & a threshold to static objects/meshes. For example, If I'm riding around in a golf cart and run over or bump into a trash can, or maybe some rocks, etc. I'm looking to attach the sound to the trash can's collision. I would expect this to be based on the impact force where I can set a threshold and assign different sounds based on the force the collision system is outputting. Can anyone help me with this?

    Thanks,
    Adam Block
    Craft Media Group
    Award Winning Sound And Music For Games
    www.craftmediagroup.com
    adam@craftmediagroup.com

    #2
    StaticMesh Event > OnComponentHit > Break Hit result

    Comment


      #3
      Originally posted by OximusPrime View Post
      StaticMesh Event > OnComponentHit > Break Hit result
      Thanks! I found the OnComponentHit event, and Break Hit Result function but I"m still not sure how to hook these up. Do you have any tips?
      Adam Block
      Craft Media Group
      Award Winning Sound And Music For Games
      www.craftmediagroup.com
      adam@craftmediagroup.com

      Comment


        #4
        Originally posted by Craft_Media_Group View Post
        Thanks! I found the OnComponentHit event, and Break Hit Result function but I"m still not sure how to hook these up. Do you have any tips?
        https://docs.unrealengine.com/latest...ult/index.html

        You can Google the term also, there should be plenty of tutorials that implement it.
        Website/Portfolio: http://www.VictorBurgosGames.com

        Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

        Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

        Comment


          #5
          Originally posted by VictorAsukaKai View Post
          https://docs.unrealengine.com/latest...ult/index.html

          You can Google the term also, there should be plenty of tutorials that implement it.
          Thank you! Much appreciated!
          Adam Block
          Craft Media Group
          Award Winning Sound And Music For Games
          www.craftmediagroup.com
          adam@craftmediagroup.com

          Comment


            #6
            Does anyone have an idea of why the sound is NOT playing when colliding with this static mesh component? I've created & specified a socket for the sound to emit from. Am I missing something basic here?

            Thanks!
            Click image for larger version

Name:	bp.PNG
Views:	1
Size:	99.7 KB
ID:	1084229
            Adam Block
            Craft Media Group
            Award Winning Sound And Music For Games
            www.craftmediagroup.com
            adam@craftmediagroup.com

            Comment


              #7
              Originally posted by Craft_Media_Group View Post
              Does anyone have an idea of why the sound is NOT playing when colliding with this static mesh component? I've created & specified a socket for the sound to emit from. Am I missing something basic here?

              Thanks!
              [ATTACH=CONFIG]53669[/ATTACH]
              Off the top of my head, two things. Did you put what sound you want to make? And second, does the mesh have collision? Check the Static Mesh Editor.
              Website/Portfolio: http://www.VictorBurgosGames.com

              Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

              Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

              Comment


                #8
                Originally posted by VictorAsukaKai View Post
                Off the top of my head, two things. Did you put what sound you want to make? And second, does the mesh have collision? Check the Static Mesh Editor.
                Yep the mesh has collision and it's set to "collision creates hit event" checked. I'm not sure what you mean by "Did you put what sound you want to make". I have an audio component that I've set up in the mesh. I'm not sure if I should be playing the sound from the audio component (get socket name) or use "Play sound at location" instead.
                Adam Block
                Craft Media Group
                Award Winning Sound And Music For Games
                www.craftmediagroup.com
                adam@craftmediagroup.com

                Comment


                  #9
                  Originally posted by Craft_Media_Group View Post
                  Yep the mesh has collision and it's set to "collision creates hit event" checked. I'm not sure what you mean by "Did you put what sound you want to make". I have an audio component that I've set up in the mesh. I'm not sure if I should be playing the sound from the audio component (get socket name) or use "Play sound at location" instead.
                  Ok, I think I understand your mistake. Or either that, or I have no idea what I'm talking about

                  So, you see how you called that Play Sound At Location node? I saw it blank, and I am assuming it's still blank. That node needs a input reference (Sound in this case) to play. It's blank. Since there's no sound reference there, it won't play anything.

                  What you thought you were doing was calling that sound from the socket location, but instead you were merely setting the locations of which it would be playing. So, usually, when you break Hit Result, you would merry up location and location, so that when you hit a particular area, it would play the sound at that location.

                  So, to fix your problem. Input the sound you want to play, then keep the socket location (since I guess that's where you want the sound to only play at)

                  The only thing is, I've only played briefly around with sockets, so not entirely too sure it it will play the sound where you want, but without trying your setup yourself, I can't think of why it just wouldn't work as I've explained above.
                  Website/Portfolio: http://www.VictorBurgosGames.com

                  Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

                  Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

                  Comment


                    #10
                    Originally posted by VictorAsukaKai View Post
                    Ok, I think I understand your mistake. Or either that, or I have no idea what I'm talking about

                    So, you see how you called that Play Sound At Location node? I saw it blank, and I am assuming it's still blank. That node needs a input reference (Sound in this case) to play. It's blank. Since there's no sound reference there, it won't play anything.

                    What you thought you were doing was calling that sound from the socket location, but instead you were merely setting the locations of which it would be playing. So, usually, when you break Hit Result, you would merry up location and location, so that when you hit a particular area, it would play the sound at that location.

                    So, to fix your problem. Input the sound you want to play, then keep the socket location (since I guess that's where you want the sound to only play at)

                    The only thing is, I've only played briefly around with sockets, so not entirely too sure it it will play the sound where you want, but without trying your setup yourself, I can't think of why it just wouldn't work as I've explained above.
                    It's funny, I've tried assigning a sound in the "play sound at location" node, and the sound never was heard. Then, I tried adding an audio component, then targeted the socket, still nothing. I'm running out of ideas. : (
                    Adam Block
                    Craft Media Group
                    Award Winning Sound And Music For Games
                    www.craftmediagroup.com
                    adam@craftmediagroup.com

                    Comment


                      #11
                      An easier way could be just set up a trigger box/sphere surrounding you're object that you want to play the sound then just use the on actor overlap node then play sound at location.

                      Also from you're screenshots the break hit node isn't connected to anything . Shouldn't this be connected to the mesh or target in some way??
                      Last edited by EniGmaa; 08-24-2015, 02:36 AM.

                      Comment


                        #12
                        Originally posted by EniGmaa View Post
                        An easier way could be just set up a trigger box/sphere surrounding you're object that you want to play the sound then just use the on actor overlap node then play sound at location.
                        Thanks for your input! If I were to use a box trigger is it possible to attach the box trigger to the mesh? If so that may work, otherwise I would have to create a box trigger for every instance of the mesh (in this case there are hundreds of them).

                        Originally posted by EniGmaa View Post
                        Also from you're screenshots the break hit node isn't connected to anything . Shouldn't this be connected to the mesh or target in some way??
                        The OnComponentHit event is an event from the mesh.
                        Last edited by eXi; 08-24-2015, 11:46 AM. Reason: Doublepost
                        Adam Block
                        Craft Media Group
                        Award Winning Sound And Music For Games
                        www.craftmediagroup.com
                        adam@craftmediagroup.com

                        Comment


                          #13
                          is this what you are trying to do??

                          so lets say you have an asset in you're content browser , in you're case its a trash can . you want to make a blueprint attached to the trash can that when you put it into the world and something hits it , then it will play a sound??
                          if so mine worked. Here is what i did.

                          so just right click the chosen asset in the content browser and go to create blueprint using this actor.

                          Click image for larger version

Name:	HKhz3iu.png
Views:	1
Size:	421.7 KB
ID:	1084375

                          Then inside the blueprint events right click and add the onComponent hit event

                          Click image for larger version

Name:	oyOWJKN.png
Views:	1
Size:	28.4 KB
ID:	1084376

                          then set it up like this. Drag a reference to the static mesh into the event graph

                          Click image for larger version

Name:	o5yjWPd.png
Views:	1
Size:	100.7 KB
ID:	1084378

                          Then drag a pin out from the reference and create a get socket location node. in the socket name write the name of you're socket. in my case this is test

                          Click image for larger version

Name:	YrY3dtt.png
Views:	1
Size:	24.0 KB
ID:	1084380

                          make sure the names are spelt exactly as they are in the socket manager

                          Click image for larger version

Name:	hTecWta.png
Views:	1
Size:	182.9 KB
ID:	1084381

                          then just plug the return value into the location value on the play sound at location nodule. so you're finished blueprint will look like this

                          Click image for larger version

Name:	qPIdigH.png
Views:	1
Size:	59.9 KB
ID:	1084382

                          One final thing on the play sound at location nodule . click the drop down box shown by the arrow and select you're sound that you want to play. in my case i used the default editor sound called compileFailed

                          Click image for larger version

Name:	PRRtkOr.png
Views:	1
Size:	38.0 KB
ID:	1084383

                          here is a demo project with it all working . just take the cube blueprint drop it in the scene multiple times and then run into it with the character and the sound will play.

                          https://www.dropbox.com/s/3mop09w1nl...oject.zip?dl=0

                          let me know if this helps thanks
                          Last edited by EniGmaa; 08-24-2015, 02:55 PM.

                          Comment


                            #14
                            Originally posted by EniGmaa View Post
                            is this what you are trying to do??

                            so lets say you have an asset in you're content browser , in you're case its a trash can . you want to make a blueprint attached to the trash can that when you put it into the world and something hits it , then it will play a sound??
                            if so mine worked. Here is what i did.

                            so just right click the chosen asset in the content browser and go to create blueprint using this actor.

                            [ATTACH=CONFIG]54066[/ATTACH]

                            Then inside the blueprint events right click and add the onComponent hit event

                            [ATTACH=CONFIG]54067[/ATTACH]

                            then set it up like this. Drag a reference to the static mesh into the event graph

                            [ATTACH=CONFIG]54071[/ATTACH]

                            Then drag a pin out from the reference and create a get socket location node. in the socket name write the name of you're socket. in my case this is test

                            [ATTACH=CONFIG]54073[/ATTACH]

                            make sure the names are spelt exactly as they are in the socket manager

                            [ATTACH=CONFIG]54074[/ATTACH]

                            then just plug the return value into the location value on the play sound at location nodule. so you're finished blueprint will look like this

                            [ATTACH=CONFIG]54075[/ATTACH]

                            One final thing on the play sound at location nodule . click the drop down box shown by the arrow and select you're sound that you want to play. in my case i used the default editor sound called compileFailed

                            [ATTACH=CONFIG]54076[/ATTACH]

                            here is a demo project with it all working . just take the cube blueprint drop it in the scene multiple times and then run into it with the character and the sound will play.

                            https://www.dropbox.com/s/3mop09w1nl...oject.zip?dl=0

                            let me know if this helps thanks
                            First of all, THANK YOU for taking the time to help with this. Unfortunately this is still not working. Would it make a difference if the object (static mesh) has it's own blueprint class? That's what I've been working from. I also made a new blueprint based off the mesh, but do I need to add that blueprint somewhere or attach it to anything? Also, I have clicked (and tried it when unclicked) the ""Simulation Generates Hit Event". Still nothing.
                            Adam Block
                            Craft Media Group
                            Award Winning Sound And Music For Games
                            www.craftmediagroup.com
                            adam@craftmediagroup.com

                            Comment


                              #15
                              Originally posted by Craft_Media_Group View Post
                              First of all, THANK YOU for taking the time to help with this. Unfortunately this is still not working. Would it make a difference if the object (static mesh) has it's own blueprint class? That's what I've been working from. I also made a new blueprint based off the mesh, but do I need to add that blueprint somewhere or attach it to anything? Also, I have clicked (and tried it when unclicked) the ""Simulation Generates Hit Event". Still nothing.
                              You need to take screenshots of every piece of BPs you have/want implemented. We've given you a few choices as to how to get this working, but I think you may be trying to do something that isn't possible or just doing it incorrectly. We need the full information to help you out.
                              Website/Portfolio: http://www.VictorBurgosGames.com

                              Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

                              Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

                              Comment

                              Working...
                              X