Hello Everyone
In an installation project, I have many actors flying around slowly and eventually rubbing against the walls and against each others. In term of blueprints, it’s a lot of hit event firing in fast sequence.
I would like to have a sound played when rubbing but I am completely at loss as how to approach this ? Any idea ?
My idea is
-
detect hit - store time and other actor (but how ?), start sound
-
as long as other hits are with the same actor, continue playing
-
If no hit event with the same actor is fired in a certain time lapse, stop sound… (but how ?)
any idea will be greatly appreciated !
Jerome
Bumping this up.
Nobody has any idea, or was my question unclear ?
This is how I would do it:
Make a collision box around your flying actors (should be same size or a centimeter bigger). Give them the correct collision setting, so that it triggers an overlap event (enter overlap and exit overlap or whatever that’s called).
When the overlap event is triggered, play the sound. Let the sound play as a loop, so that it continues for as long as the collision box overlaps the wall (or whatever contact you want it to play to rub sound on).
Create a blueprint function that checks for the velocity of the flying actor.
Now insert this function into the rest of your blueprint, so that it stops the rubby sound when the actor velocity = 0. Simply make a “if” node and if the velocity > 0, then on true play the sound (which plays as a loop).
Basically like this:
Event Begin Overlap -> Velocity Function -> If Node -> Play sound at location.
Event End Overlap -> Stop play sound
If you want to be fancy, you can make it so that if the actor velocity goes below a certain number, the rubby sound becomes more quiet, until it stops at zero.
Thank you very much !
That will work I think. Using the Event Hit, I could manage to make up something but it’s awfully complicated. I’ll replace with your Idea !
Hit for the impact sound, and Overlap for the rubbing sound.
You’re welcome, and please post your work here in the forum when you’re finished, I’m curious what it turned into!
By the way, I think there is a node “get physics linear velocity” that you can use, it gives you the speed of an actor in vector values. I use it for my spaceship game and it’s very precise. Although it needs your actors to have physics enabled.