Hi,
I have a blueprint for a physics object and I want it to play a sound every time there is an impact . This is works , but I also want to be able to play a different sound at different volume depending on impact.
In UDK we used this layout which worked.
In Rocket I have had some success getting sound to play using this layout.
problem is I have not been able to calculate impact properly so I can not get it to play right sound at right time.
Part of reason why I am struggling is that I do not fully understand what each connection from “RecieveHit” and “Break Hit Results” does . other complication is that impact results are a vector which makes it more difficult to calculate speed of impact.
Am I using right connections or is there a better way? any information would be useful.
Thanks
1 Like
Hit Location
You should use Hit Location as place to play sound at
Vector Length for Correct Calculations
You definitely are not going to get consistent results measuring whether each component of vector is > than a positive large number,
you should use vector length
vector length returns positive size of vector, whereas components could be legitimately negative
You might want to use Print Message to find out what sort of impulse values you get with this method.
Here’s a pic for you!
PS: regarding hit event, which parts do you want more info about?
1 Like
Thanks , Vector Length did trick.
For future reference it would be useful to know what “HitNormal” and “ImapctNormal” are for.
Yay!
I’m glad you got it working!
PS: Hitnormal = unit vector that is perpendicular to surface of object at hitpoint, so basically, way surface of object itself is facing at point of impact.
so if you hit a big cube that directly below Sun, and you hit cube from top, impact normal will always be point straight up at sun
but if you hit cube on sides, hit normal goes in direction that side of cube is facing.
Impact Normal, quote from Epic’s source .h files
/** Normal of hit from actual contact of trace shape in world space */
I have a similar problem and setup that I need to resolve, and like case of original question, I had a setup in UE3 that used Rigid Body Collision event, combined with Impact Velocity in order to produce different effects depending on intensity of collision. problem is that I don’t know how to set up equivalent of “Instigator” in UE4 setup. Instigator bubble would allow me to run a compare check on what caused Rigid Body Collision. With this setup I could make sure that it was something like a player attack that could cause an impulse that destroys an actor, versus it just falling down or being pushed around. Is there a way to perform this Instigator check in UE4? Also, I tried vector length solution described above, but numbers coming out if it are extremely inconsistent, compared to results I would get with Impact Velocity in UE3. Is there any solution closer to UE3 setup that can be suggested? Thank you.
Hey princemoonrise,
This is an old Archive post from our beta users, put here for reference, and may contain out-of-date information. If you’re having a similar issue, please feel free to open a new post with as many details as you can. You can link to this post for reference if you need to. Thanks!