x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to detect and play different sound when the ball hits the door vs floor vs desk?

I have been getting really far with BluePrints and I figured this would be easy. Essentially, I have a ball that has physics and collisions enabled. The other objects have collisions enabled. I would like to have only the ball make a different sound when it hits the door, vs when it hits the floor, or the desk, not any other actor that triggers those collision boxes or hit events.

Can someone please share a simple blueprint layout or video that does this? One moving actor that hits 3 different static actors and makes a different sound when it hits each one.

Ideally I would like the Ball's blueprint to detect which static mesh it hits and then triggers the appropriate sound accordingly, so then I can copy that blueprint script into other actors who may hit the wall, door, or desk and play different sounds in the future.

I have googled and googled, youtubed and youtubed, and hunted this forum. I feel lost. Thank you.

Product Version: UE 4.15
Tags:
more ▼

asked Mar 12 '17 at 06:15 AM in Blueprint Scripting

avatar image

AtmaStudios
11 3 5 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

heyho :)

try to work with that here: maybe u have to adapt it a little bit , but defining tags (i guess case sensitive!)to the actors(objects you roll on , walls doors,grounds) and checking at a component hit would be a simple solution

be careful this doesnot work with bsp brushes i guess^^

alt text

i hope i could help a little bit

help1.png (231.5 kB)
more ▼

answered Mar 12 '17 at 11:30 AM

avatar image

Erytriel
324 14 3 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Erytriel,

First off thank you for taking the time to try and help me. I have copied this piece for piece into my project assigning each to it's respective part. The only thing I could not find is "OnComponentHit" no matter what I typed I could not find that in my blueprints. My Ball actor is a BluePrint class if that changes anything?

Unfortunately it is not working for me. :(

Here is a screen shot. alt text

Thank you again!

more ▼

answered Mar 13 '17 at 05:12 AM

avatar image

AtmaStudios
11 3 5 6

avatar image Erytriel Mar 13 '17 at 12:34 PM

i created a collisionsphere , a little bit bigger than the character so when it hits something ,the whole thing should fire^^

you get access to this "on actor hit" if you click on the collisionsphere/box whatever you could created on the left side of your blueprint where the mesh and capsule component also is.

then click it, and under details scroll to the bottom where all avaivable action are and clik on it (hit, overlap and and and)

avatar image AtmaStudios Mar 21 '17 at 09:44 PM

A collisionsphere? Like on the ball actor as a component?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question